Initial commit with contrats and domaines modules

This commit is contained in:
mrKamoo
2026-04-08 18:07:08 +02:00
commit 092a6a0484
191 changed files with 24639 additions and 0 deletions

32
app/Models/Categorie.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Builder;
class Categorie extends Model
{
protected $fillable = ['nom', 'description', 'couleur', 'icone', 'ordre', 'active'];
protected $casts = [
'active' => 'boolean',
'ordre' => 'integer',
];
public function articles(): HasMany
{
return $this->hasMany(Article::class);
}
public function lignesCommande(): HasMany
{
return $this->hasMany(LigneCommande::class);
}
public function scopeActive(Builder $query): Builder
{
return $query->where('active', true);
}
}