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

22 lines
401 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Game;
use App\Models\Tag;
class Language extends Model
{
protected $table = 'languages';
public $timestamps = false;
public function games() {
return $this->belongsToMany(Game::class, 'languages_games');
}
public static function findByCode($code) {
return self::where('code', $code)->first();
}
}