<?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();