Skip to content
Snippets Groups Projects
Commit 72a840ad authored by Verin Antoine's avatar Verin Antoine
Browse files

Merge branch 'models' into 'main'

Add TypeBateau

See merge request !22
parents ef898c14 eef557b1
Branches
1 merge request!22Add TypeBateau
......@@ -4,10 +4,16 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Bateau extends Model
{
use HasFactory;
protected $table = 'bateaux';
public function type(): BelongsTo
{
return $this->belongsTo(TypeBateau::class, 'id_type');
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TypeBateau extends Model
{
use HasFactory;
protected $table = 'type_bateaux';
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment