Created
June 24, 2021 02:25
-
-
Save epicsagas/8c4eca6af3968d06a325bf47c134c404 to your computer and use it in GitHub Desktop.
Revisions
-
epicsagas created this gist
Jun 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <?php namespace App\\Models; use Eloquent; class Post extends Eloquent { protected $appends = [ 'thumbnail', ]; // Will raise "Undefined index:" exception without below hidden original attribute. protected $hidden = [ 'thumbnail', ]; pubilc function getThumbnailAttribute() { return $this->attributes['thumbnail']; } }