Backend for songs.zachdecook.com
Diffstat (limited to 'laravel/app/Song.php')
| -rw-r--r-- | laravel/app/Song.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/laravel/app/Song.php b/laravel/app/Song.php index f31c7ce..a50a5f0 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -7,7 +7,7 @@ use App\Http\Controllers\SongController; class Song extends Model { - public $fillable = ['number', 'title', 'author', 'key', 'text']; + public $fillable = ['number', 'title', 'author', 'key', 'text']; public function playlists() { return $this->belongsToMany('App\Playlist'); @@ -43,8 +43,8 @@ class Song extends Model public function setTextAttribute($text) { // Watch out, this saves immediately! - if ($text && file_put_contents("public/text/{$this->id}.txt", $text)) { - $this->attributes['text'] = null; + if ($text) { + file_put_contents("public/text/{$this->id}.txt", $text); } } public function getChordsAttribute($txt = null) |