61 lines
970 B
PHP
61 lines
970 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Commentaire
|
|
*
|
|
* @property int $id
|
|
* @property Carbon $COM_DATE
|
|
* @property string $COM_AUTEUR
|
|
* @property string $COM_CONTENU
|
|
* @property int $billet_id
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
*
|
|
* @property Billet $billet
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Commentaire extends Model
|
|
{
|
|
protected $table = 'commentaires';
|
|
|
|
protected $casts = [
|
|
'COM_DATE' => 'datetime',
|
|
'billet_id' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'COM_DATE',
|
|
'COM_AUTEUR',
|
|
'COM_CONTENU',
|
|
'billet_id',
|
|
'user_id'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'id',
|
|
'created_at',
|
|
'updated_at',
|
|
'billet_id'
|
|
];
|
|
|
|
public function billet()
|
|
{
|
|
return $this->belongsTo(Billet::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|