Ejemplo n.º 1
0
 /**
  * Get the query object to be processed by datatables.
  *
  * @return \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder
  */
 public function query()
 {
     $users = Navigation::query();
     return $this->applyScopes($users);
 }
Ejemplo n.º 2
0
 /**
  * Publish/Unpublish a menu.
  *
  * @param \Yajra\CMS\Entities\Navigation $navigation
  * @param \Yajra\CMS\Entities\Menu $menu
  * @return \Illuminate\Http\JsonResponse
  */
 public function publish(Navigation $navigation, Menu $menu)
 {
     /** @var \Yajra\CMS\Entities\Menu $menu */
     $menu = $navigation->menus()->findOrFail($menu->id);
     $menu->togglePublishedState();
     return $this->notifySuccess(sprintf('Menu successfully %s!', $menu->published ? 'published' : 'unpublished'));
 }
Ejemplo n.º 3
0
 /**
  * Publish/Unpublish a navigation.
  *
  * @param \Yajra\CMS\Entities\Navigation $navigation
  * @return \Illuminate\Http\JsonResponse
  */
 public function publish(Navigation $navigation)
 {
     $navigation->togglePublishedState();
     return $this->notifySuccess(sprintf(trans('cms::navigation.update.publish'), $navigation->published ? 'published' : 'unpublished'));
 }