myaac/system/src/Models/Pages.php
Slawomir Boczek fe7ad61abe
phpstan support (#250)
* phpstan v1 + workflow

* Fix intend

* More fixes

* Update phpstan.neon

* phpstan level 2

* Move errors ignoring into phpstan.neon

* phpstan level 3

* Don't ignore templates folder

* Something from level 4

* Update phpstan.neon
2024-02-18 14:59:25 +01:00

38 lines
710 B
PHP

<?php
namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $name
* @property string $title
* @property int $php
* @property int $hide
*/
class Pages extends Model {
protected $table = TABLE_PREFIX . 'pages';
public $timestamps = false;
protected $fillable = ['name', 'title', 'body', 'date', 'player_id', 'php', 'enable_tinymce', 'access', 'hide'];
protected $casts = [
'player_id' => 'integer',
'enable_tinymce' => 'integer',
'access' => 'integer',
'hide' => 'integer',
];
public function player()
{
return $this->belongsTo(Player::class);
}
public function scopeIsPublic($query) {
$query->where('hide', '!=', 1);
}
}