Archived
1
0
Fork 0
This repository has been archived on 2021-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
ifnews/app/Models/Game.php

32 lines
664 B
PHP
Raw Normal View History

2019-09-12 20:03:56 +03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Author;
use App\Models\Language;
use App\Models\Tag;
use App\Models\Platform;
class Game extends Model
{
2019-11-30 08:08:17 +02:00
protected $table = 'games';
public $guarded = ['id'];
2019-09-12 20:03:56 +03:00
public function authors() {
return $this->belongsToMany(Author::class, 'authors_games');
}
public function languages() {
return $this->belongsToMany(Language::class, 'languages_games');
}
public function tags() {
return $this->belongsToMany(Tag::class, 'tags_games');
}
2019-11-30 09:03:43 +02:00
public function platforms() {
return $this->belongsToMany(Platform::class, 'games_platforms', 'game_id', 'platform_id');
2019-09-12 20:03:56 +03:00
}
}