22 lines
398 B
PHP
22 lines
398 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use \App\Setting;
|
|
|
|
class Season extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name'
|
|
];
|
|
/*
|
|
public function isActive() {
|
|
return $this->hasOne('App\Setting','season_id');
|
|
}
|
|
*/
|
|
|
|
public static function getCurrent() {
|
|
return \App\Season::orderBy('id','desc')->where('active','=','1')->first();
|
|
}
|
|
}
|