From af228f705dc7b16fcd69b8288109675957918488 Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Tue, 30 Jun 2020 09:19:35 +0200 Subject: [PATCH] Removed unnecessary files --- skolehjem/app/Album.php | 19 +++++++++++- skolehjem/app/Image.php | 10 ------ skolehjem/app/Video.php | 10 ------ .../2020_06_30_065200_create_images_table.php | 31 ------------------- .../2020_06_30_065206_create_videos_table.php | 31 ------------------- 5 files changed, 18 insertions(+), 83 deletions(-) delete mode 100644 skolehjem/app/Image.php delete mode 100644 skolehjem/app/Video.php delete mode 100644 skolehjem/database/migrations/2020_06_30_065200_create_images_table.php delete mode 100644 skolehjem/database/migrations/2020_06_30_065206_create_videos_table.php diff --git a/skolehjem/app/Album.php b/skolehjem/app/Album.php index e8571ed..e32fee6 100644 --- a/skolehjem/app/Album.php +++ b/skolehjem/app/Album.php @@ -6,5 +6,22 @@ use Illuminate\Database\Eloquent\Model; class Album extends Model { - // + protected $fillable = [ + 'name' + ]; + + public function parentAlbum() + { + return $this->belongsTo('App\Album'); + } + + public function images() + { + return $this->hasMany('App\Image'); + } + + public function videos() + { + return $this->hasMany('App\Video'); + } } diff --git a/skolehjem/app/Image.php b/skolehjem/app/Image.php deleted file mode 100644 index bbb58f5..0000000 --- a/skolehjem/app/Image.php +++ /dev/null @@ -1,10 +0,0 @@ -id(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('images'); - } -} diff --git a/skolehjem/database/migrations/2020_06_30_065206_create_videos_table.php b/skolehjem/database/migrations/2020_06_30_065206_create_videos_table.php deleted file mode 100644 index fa4dc4d..0000000 --- a/skolehjem/database/migrations/2020_06_30_065206_create_videos_table.php +++ /dev/null @@ -1,31 +0,0 @@ -id(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('videos'); - } -}