31 lines
668 B
PHP
31 lines
668 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class RenduDevoir extends Model
|
||
|
|
{
|
||
|
|
protected $table = 'rendus_devoirs';
|
||
|
|
|
||
|
|
protected $fillable = ['devoir_id', 'eleve_id', 'reponse', 'note', 'rendu_a'];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'rendu_a' => 'datetime',
|
||
|
|
'note' => 'integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
/** @return BelongsTo<Devoir, $this> */
|
||
|
|
public function devoir(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Devoir::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** @return BelongsTo<Eleve, $this> */
|
||
|
|
public function eleve(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Eleve::class);
|
||
|
|
}
|
||
|
|
}
|