¨4.0.1¨
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Menu\Entities;
|
||||
|
||||
use Modules\Admin\Ui\AdminTable;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Modules\Support\Eloquent\Model;
|
||||
use Modules\Support\Eloquent\Translatable;
|
||||
|
||||
@@ -40,15 +41,6 @@ class Menu extends Model
|
||||
*/
|
||||
protected $translatedAttributes = ['name'];
|
||||
|
||||
/**
|
||||
* Perform any actions required after the model boots.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::addActiveGlobalScope();
|
||||
}
|
||||
|
||||
public static function for($menuId)
|
||||
{
|
||||
@@ -60,15 +52,28 @@ class Menu extends Model
|
||||
->nest();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform any actions required after the model boots.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::addActiveGlobalScope();
|
||||
}
|
||||
|
||||
|
||||
public function menuItems()
|
||||
{
|
||||
return $this->hasMany(MenuItem::class)->orderByRaw('-position DESC');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get table data for the resource
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function table()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user