Files
UNIT3D-Community-Edition/app/Models/Person.php
HDVinnie 992245bbcc Apply fixes from StyleCI
[ci skip] [skip ci]
2020-10-28 20:42:44 +00:00

45 lines
1.1 KiB
PHP

<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Person extends Model
{
protected $guarded = [];
protected $primaryKey = 'id';
public $timestamps = false;
public $table = 'person';
public function tv()
{
return $this->belongsToMany(Tv::class, 'person_tv', 'tv_id', 'person_id');
}
public function season()
{
return $this->belongsToMany(Season::class, 'person_season', 'season_id', 'person_id');
}
public function episode()
{
return $this->belongsToMany(Episode::class, 'episode_person', 'episode_id', 'person_id');
}
public function movie()
{
return $this->belongsToMany(Movie::class, 'person_movie', 'movie_id', 'person_id');
}
}