일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- cartalyst
- as후기
- AWS
- 개인사업자
- Python
- Bootstrap
- Sentinel
- 이더리움
- 당사자표시정정신청서
- Tutorial
- Laravel
- auth
- blockchain
- Java
- 코로나
- 소액임금체불
- reactnative
- elasticSearch
- 코로나19
- 전자소송
- javascript
- 체당금
- 보정명령
- Eclipse
- win32
- vue
- 인민공원
- 사업자계좌
- php
- Blade
- Today
- Total
목록Development (102)
그냥 사는 이야기
Social Network Login with Username email login 대신 새로 추가한 username으로 로그인 구현 username view login.blade.php Username @if ($errors->has('username')) {{ $errors->first('username') }} @endif email -> username type -> text E-Mail Address -> Username login 관련 패키지 변경 vendor를 건드리는 방법 Illuminate/Foundation/Auth/AuthenticatesUsers.php 이곳에서 보면 login() 내에 credentials()를 체크하는 곳을 보면 username()를 사용한다. 하지만 이것은 그냥..
Social Network Custom Registration 우선 라라벨 프로젝트를 생성 Migrate php artisan migrate Auth php artisan make:auth 유저 항목 customizing public function up() { Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('username', 32); // 추가 $table->date('dob'); // 추가 $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->rememberTok..
Pagination 게시판에서 보면 1, 2, 3 page와 prev, next 링크가 존재하는 형태 Pagination 추가 UserController public function index() { $users = User::paginate(10); // $users = User::simplePaginate(10); // 숫자가 없는 형태 return view('admin.users.index', compact('users')); } index.blade.php // 유저 list ... {{ $users->links() }} Total 그리고 현재 count 보여주기 index.blade.php {{ $users->total() }} total users In this page ({{ $users->..
Laravel 5.3 Tutorial for Beginner - Blade subviews menu/footer 생성 views/layouts 에 아래의 2파일 추가 추가 menu.blade.php footer.blade.php menu.blade.php Home About Contact Project name footer.blade.php © {{ date('Y') }} Company, Inc. master.blade.php ... @include('layouts.menu') @yield('body') @include('layouts.footer') ...
Laravel 5.3 Tutorial for Beginner - Blade layouts Route & Controller & View routes/web.php 에서 아래 추가 Route::get('blade', 'PagesController@blade'); PageController.php 에서 아래 추가 public function blade() { return view('blade.bladetest'); } views/layouts/master.blade.php 파일 생성 views/blade/bladetest.blade.php 파일 생성 bladetest.blade.php에는 아래를 추가한다. @extends('layouts.master') Bootstrap에서 가져오기 소스 복사 Bootstr..
Laravel 5.3 Tutorial for Beginner - View Composers 별도의 ServiceProvider 생성 php artisan make:provider ComposerServiceProvider 생성한 Service Provider Class를 등록해준다. config/app.php ... App\Providers\ComposerServiceProvider::class, ... ProfileComposer 생성 Http에 ViewComposers 폴더를 생성하고 ProfileComposer.php 파일을 생성한다. App/Http/ViewComposers/ProfileComposer.php
Laravel 5.3 Tutorial for Beginner - Sharing data with all Views 한개의 변수 공유 App/Providers/AppServiceProvider.php use View; ... public function boot() { View::share('myname', 'Renato'); } ... 그리고 View에서 아래처럼 추가하면 myname을 사용할 수 있다. home.blade.php Hello, {{ $myname }} Carbon 패키지 사용해 보기 나이(age) 정보를 share 변수로 등록해보는데 Carbon 패키지를 사용해 본다. App/Providers/AppServiceProvider.php use Carbon\Carbon; ... public ..
Laravel 5.3 Tutorial for Beginner - Mutators & Accessors Mutators Mutators는 Setter와 같다. 이것은 Controller에서 data를 get/set 해주는 것과 달리 Model에서 정해줄 수 있다. setXXXAttribute 작성 App/User.php public function setNameAttribute($value) { $this->attributes['name'] = ucfirst($value); } ucfirst()는 단어의 첫글자를 대문자로 만들어주는 함수이다. password 암호화를 Mutators에서 작성 Controller에서 암호화 하는 부분을 제거 App/Http/Controllers/Auth/RegisterCon..