river

Joined: 10 years ago
Total tricks: 68
Last trick: 7 years ago

Submitted tricks

laravel 5.4 새 기능
동영상 Laracast 무료 시리즈 - What's New in Laravel 5.4 Laracast 무료 시리즈 - Laravel 5.4 From Scratch Laravel 5.4 New Features - Part 1: All the Small Changes Overview Part 2: Laravel Mix [Laravel 5.4 New Features] articles What’s New…
Submitted 7 years ago in Features
4636
0
0
5.4
console 로그와 웹 로그 분리하기
로그 설정을 daily로 하고, artisan command 등의 console 명령을 스케쥴링을 통하여 수행하는 경우 console 계정과 웹 계정의 차이로 인해 다음의 문제가 발생하는 경우가 있다. Failed to open stream:…
Submitted 7 years ago in Configuration, Debugging
5890
0
0
5.1
Laravel 버전 확인하기 및 Laravel 특정 버전 설치하기
글을 작성했는데, 모호한 부분이 있어서 draft로 바꿈. php artisan --version 출력은 vendor/symfony/console/Application.php:162에서 행해진다. 버전 정보는 \Illuminate\Foundation\Application::VERSION에 하드코딩되어…
Submitted 8 years ago in Composer
13
0
0
Laravel 5에서 로깅 설정 변경하기
Illuminate\Foundation\Bootstrap\ConfigureLogging 오버라이딩 bootstrap\ConfigureLogging.php 생성 <?php namespace Bootstrap; use Illuminate\Log\Writer; use Illuminate\Contracts\Foundation\Application; use…
Submitted 8 years ago in Debugging, Configuration
5248
0
0
Lumen에서 daily log 사용하기
Lumen에서는 storage/logs/lumen.log 하나의 파일에 로그가 기록된다. 로그에 대한 설정은 getMonologHandler에서 행해진다. Laravel\Lumen\Application ... /** * Register container bindings for the application. * * @return void */…
Submitted 8 years ago in Configuration, Lumen, Debugging
6089
0
0
라우팅 별칭이름
확인필요 Route::getCurrentRoute()->getAction()["as"] Route::getCurrentRoute()->getName() Route::getCurrentRoute()->getActionName() <li class="{{ (Route::getCurrentRoute()->getAction()["as"] == "dashboard.index") ? 'active' : ''…
Submitted 8 years ago in Routing
23
0
0
스키마 빌더에서 컬럼 주석 사용하기
스키마 작성시 comment 메서드를 사용하면 컬럼에 주석을 달 수 있다. public function up() { Schema::create('posts', function(Blueprint $table) { $table->increments('id')->comment('Unique identifier');…
Submitted 8 years ago in Migration
3464
0
0
로그인한 후 리다이렉트 되는 URL 변경하기
Laravel은 로그인이 성공한 뒤 /home 으로 라다이렉트한다. 이를 다른 URL로 변경하려면 AuthController에 $redirectPath 속성을 추가해서 지정하면 된다. App\Http\Controllers\Auth\AuthController namespace…
Submitted 8 years ago in Security
4050
0
0
5.1
PasswordBroker 오버라이딩하기
비밀번호 리셋에 관련된 로직은 Illuminate\Auth\Passwords\PasswordBroker 클래스에서 수행이 되는데, 이 로직을 변경하고자 한다면 다음의 방법을 사용하면 된다. CustomPassowordBroker 생성…
Submitted 8 years ago in Security
3478
0
0
5.1
blade의 @endsection 과 @stop 의 차이점
@section('content') @stop blade의 섹션을 닫을 때, Laravel 3에서는 @endsection, Laravel 4에서는 @stop으로 바뀐 걸로 알고 있었는데, Laravel 5 예제 소스들에서 @endsection이 보여서 둘 간의 차이점을 찾아봤다.…
Submitted 8 years ago in Views, Template
4021
0
0
Lumen, Laravel 겸용 패키지 만들기
패키지를 개발할 때, Laravel과 Lumen을 동시에 지원하고자 한다면, config 관련해서는 다음의 방법을 사용할 수 있다. class SampleServiceProvider extends ServiceProvider { /** * Bootstrap the application events. * *…
Submitted 8 years ago in Lumen
4244
0
0
최적화 명령어들
최적화 명령어들 php artisan optimize php artisan config:cache php artisan route:cache 최적화 명령어로 생성된 캐시 삭제 명령어들 php artisan clear-compiled php artisan config:clear php artisan route:clear php artisan view:clear…
Submitted 8 years ago in Performance
3737
0
0
특정 라우팅은 HTTPS 만 가능하게 하기
특정 요청은 무조건 https로만 접근하게 하고자 할 때, http로 접속한 경우 https로 리다이렉트 하도록 하기 위해서 다음의 Middleware를 사용하면 된다. app/Http/Middleware/ForceHttps.php <?php namespace…
Submitted 8 years ago in Routing
3589
0
0
URL과 쿼리스트링 구하기
http://example.com/test?foo=bar url() // http://example.com Request::getPathInfo() // /test Request::url() // http://example.com/test Request::fullurl() // http://example.com/test?foo=bar Request::getQueryString() // foo=bar
Submitted 8 years ago in Request and Input
3669
0
0
updated_at 컬럼 사용하지 않기
Laravel Eloquent는 timestamp 컬럼인 created_at, updated_at 에 대해서 자동으로 날짜를 설정하고, 갱신하는 작업을 수행하다. 이 중 created_at 컬럼은 사용하고, updated_at 컬럼은 사용하지 않을 경우에는…
Submitted 8 years ago in Eloquent
3910
0
0