60 lines
1.0 KiB
PHP
60 lines
1.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Billet
|
|
*
|
|
* @property int $id
|
|
* @property Carbon $BIL_DATE
|
|
* @property string $BIL_TITRE
|
|
* @property string $BIL_CONTENU
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
*
|
|
* @property Collection|BilletCategorie[] $billet_categories
|
|
* @property Collection|Commentaire[] $commentaires
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Billet extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $table = 'billets';
|
|
|
|
protected $casts = [
|
|
'BIL_DATE' => 'datetime'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'BIL_DATE',
|
|
'BIL_TITRE',
|
|
'BIL_CONTENU'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'id',
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
public function billet_categories()
|
|
{
|
|
return $this->hasMany(BilletCategorie::class);
|
|
}
|
|
|
|
public function commentaires()
|
|
{
|
|
return $this->hasMany(Commentaire::class);
|
|
}
|
|
}
|