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/Author.php

21 lines
376 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Game;
class Author extends Model
{
protected $table = 'authors';
public $timestamps = FALSE;
public function games() {
return $this->belongsToMany(Game::class, 'authors_games');
}
public static function findByName($name) {
return self::where('name', $name)->first();
}
}