This commit is contained in:
Lizandro Guarnizo
2026-04-24 21:40:10 -05:00
parent 877a0d393a
commit 148fa6b9f9
36 changed files with 3037 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WhatsappMenu extends Model
{
protected $table = 'whatsapp_menus';
protected $fillable = [
'name', 'title', 'message', 'parent_id', 'is_main', 'is_active', 'sort_order',
];
protected $casts = [
'is_main' => 'boolean',
'is_active' => 'boolean',
];
public function options()
{
return $this->hasMany(WhatsappMenuOption::class, 'menu_id')->orderBy('sort_order');
}
public function parent()
{
return $this->belongsTo(WhatsappMenu::class, 'parent_id');
}
public function children()
{
return $this->hasMany(WhatsappMenu::class, 'parent_id');
}
}