title = "Category" url = "/category" layout = "Dashboard" is_hidden = 0 [session] security = "user" allowedUserGroups[] = "admin" allowedUserGroups[] = "supplier" redirect = "dashboard/login" == vendor; $this['categorys'] = Category::orderBy('created_at', 'desc')->get(); $this['active_category'] = Category::orderBy('created_at', 'desc')->where('published', 1)->count(); $this['all_category'] = Category::orderBy('created_at', 'desc')->count(); } $this['category'] = Category::make(); } function onDelete() { $categoryId = Input::post('id_category'); $category = Category::find($categoryId); if ($category) { $category->delete(); } return redirect()->refresh(); } ?> ==
Category Active

{{active_category}} {{ (active_category > 1) ? 'Categories' : 'Category'}}

All Category

{{all_category}} {{ (all_category > 1) ? 'Categories' : 'Category'}}

List Category

Add

{% for key, category in categorys %} {% endfor %}
Name Published Main Category Created
{{ category.name }} {{ (category.published == 1) ? 'Yes' : 'No' }} {{ (category.main == 1) ? 'Yes' : 'No' }} {{ category.created_at|date('d F Y') }}
{% put scripts %} {% endput %}