News: Bug fixes, cleanup, comments & formatting
Use more magically available methods and properties Fixed atom feed and stats not using the new modelmain
parent
6534191d59
commit
b878740f80
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Engelsystem\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Engelsystem\Models\User\UsesUserModel;
|
||||
use Illuminate\Database\Query\Builder as QueryBuilder;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property string $text
|
||||
* @property bool $is_meeting
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static QueryBuilder|LogEntry[] whereId($value)
|
||||
* @method static QueryBuilder|LogEntry[] whereTitle($value)
|
||||
* @method static QueryBuilder|LogEntry[] whereText($value)
|
||||
* @method static QueryBuilder|LogEntry[] whereIsMeeting($value)
|
||||
* @method static QueryBuilder|LogEntry[] whereCreatedAt($value)
|
||||
* @method static QueryBuilder|LogEntry[] whereUpdatedAt($value)
|
||||
*/
|
||||
class News extends BaseModel
|
||||
{
|
||||
use UsesUserModel;
|
||||
|
||||
/** @var bool Enable timestamps */
|
||||
public $timestamps = true;
|
||||
|
||||
/** @var array */
|
||||
protected $casts = [
|
||||
'is_meeting' => 'boolean',
|
||||
];
|
||||
|
||||
/** @var array */
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'text',
|
||||
'is_meeting',
|
||||
'user_id',
|
||||
];
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Engelsystem\Models\News;
|
||||
|
||||
use Engelsystem\Models\User\UsesUserModel;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* This class represents a news item.
|
||||
*/
|
||||
class News extends Model
|
||||
{
|
||||
use UsesUserModel;
|
||||
|
||||
protected $casts = [
|
||||
'is_meeting' => 'boolean',
|
||||
];
|
||||
|
||||
protected $attributes = [
|
||||
'is_meeting' => false,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'text',
|
||||
'is_meeting',
|
||||
'user_id',
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue