레이블이 php인 게시물을 표시합니다. 모든 게시물 표시
레이블이 php인 게시물을 표시합니다. 모든 게시물 표시

2021년 6월 21일 월요일

Top Laravel Eloquent Features You May Not Know.

 

1. Check if Model changed

2. Get original attributes

3. Get changed attributes

Note: Here you need to keep in mind that, you will only get changes back if you save it or sync the changes with syncChanges()

4. Custom deleted_at column

5. Save relationships and models

6. Reload fresh model

7. Reload existing model

8. Check if models are the same

9. Clone a model

10. Specify attributes in find() method

Finally…

2021년 1월 18일 월요일

Using the SetCacheHeaders middleware

 

  • no-cache and etag will allow the user to refresh the page (even before the expiration time) without downloading the whole page if the latest published podcasts are still the same.
  • private says the homepage is per-user, and should be cached only in the user device rather than, for example, a proxy.
  • max-age=300 will set an expiration time of 5 minutes, since after that time surely there is a new Podcast published.

Route::get('/', 'PodcastController@index')
->middleware('cache.headers:no-cache,private,max-age=300;etag');

2014년 5월 9일 금요일

[PHP] 에러 출력되지 않는 환경에서 강제로 에러 표시

에러 출력되지 않는 환경에서 강제로 에러 표시
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);