From 2f7b60be74edc021f801a0c7c7cc0ffc2160ca4a Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Thu, 30 Sep 2021 05:57:09 +0000 Subject: misc improvements --- laravel/app/Song.php | 6 +++--- laravel/public/music/.gitignore | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 laravel/public/music/.gitignore (limited to 'laravel') 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) diff --git a/laravel/public/music/.gitignore b/laravel/public/music/.gitignore new file mode 100644 index 0000000..682d0c8 --- /dev/null +++ b/laravel/public/music/.gitignore @@ -0,0 +1 @@ +*.mp3 -- cgit 1.4.1