일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 사업자계좌
- Java
- Python
- 전자소송
- javascript
- 보정명령
- 코로나19
- Blade
- cartalyst
- 인민공원
- auth
- Sentinel
- Bootstrap
- 체당금
- Tutorial
- vue
- 이더리움
- win32
- 개인사업자
- Laravel
- 소액임금체불
- 홈택스
- php
- 코로나
- Eclipse
- elasticSearch
- 당사자표시정정신청서
- blockchain
- as후기
- reactnative
- Today
- Total
목록Development (103)
그냥 사는 이야기
Bootstrap 적용 Dashboard template 의 소스를 구해서 적용해본다. View 추가 resources/views/layouts/dashboard.blade.php Toggle navigation @if (Auth::guest()) Members Login Register @else {{ Auth::user()->name }} Logout {{ csrf_field() }} @endif Overview (current) All Posts Drafts Comments Label User Profile @yield('content') resources/views/admin/index.blade.php @extends('layouts.dashboard') @section('content') Da..
Bootstrap 적용 Clean Blog theme 를 down 받는다. 그래서 모든 폴더(css, img, js, less, mail, vendor)를 public 밑으로 복사해 둔다. View 추가 resources/views/layouts/app.blade.php Toggle navigation Menu Study Home About Sample Post Contact @if (Auth::guest()) Members Login Register @else {{ Auth::user()->name }} Logout {{ csrf_field() }} @endif @yield('content') resources/views/auth/login.blade.php, register.blade.php @ext..
Post와 Comment 구현 Model App/Post class Post extends Model { protected $guarded = []; public function comments() { return $this->hasMany('App\Comment','on_post'); } public function author() { return $this->belongsTo('App\User','author_id'); } } App/Comment class Comment extends Model { protected $guarded = []; public function author() { return $this->belongsTo('App\User','from_user'); } public fun..
Setup database Auth 추가 php artisan make:auth database/migrations/CreateUsersTable $table->enum('role',['admin','author','subscriber'])->default('author'); php artisan migrate database seed 추가 database/seeds/DatabaseSeeder use App\User; class DatabaseSeeder extends Seeder { public function run() { $this->call(UsersTableSeeder::class); } } class UsersTableSeeder extends Seeder { public function ru..
Visitor 권한 우선 VisitorMiddleware를 만든다. php artisan make:middleware VisitorsMiddleware routes/web.php Route::group(['middleware' => 'visitors'], function() { Route::get('/register', 'RegistrationController@register'); Route::post('/register', 'RegistrationController@postRegister'); Route::get('/login', 'LoginController@login'); Route::post('/login', 'LoginController@postLogin'); }); visitor가 접근 할 ..
Admin Controller 추가 php artisan make:controller AdminController routes/web.php Route::get('earnings', 'AdminController@earnings'); AdminController public function earnings() { return 'Total earnings 999'; } Admin Middleware 추가 php artisan make:middleware AdminMiddleware App/Http/Middleware/AdminMiddleware.php use Sentinel; ... public function handle($request, Closure $next) { // 1. User should b..
roles 데이터 추가 Sentinel로 구성된 db에는 roles 라는 테이블이 존재한다. 여기에 2개의 data를 insert 하는데 slug, name column에 admin, Admin manager, Manager 이렇게 2개의 data를 insert 한다. role 부여 user를 register 할 때 이전 단계에서 생성했던 role중 manager role을 주는 방법은 RegistrationController public function postRegister(Request $request) { $user = Sentinel::registerAndActivate($request->all()); $role = Sentinel::findRoleBySlug('manager'); // 추가 $..
logout 구현 web.php Route::post('/logout', 'LoginController@logout'); LoginController public function logout() { Sentinel::logout(); return redirect('/login'); } top.menu.php @if(Sentinel::check()) {{ csrf_field() }} Logout @else Login Register @endif @if(Sentinel::check()) Hello, {{ Sentinel::getUser()->first_name }} @else Authentication with Sentinel @endif