title = "Blog" url = "/blog" layout = "Dashboard" is_hidden = 0 [session] security = "user" allowedUserGroups[] = "admin" allowedUserGroups[] = "supplier" redirect = "dashboard/login" == vendor; $this['blogs'] = Blog::orderBy('created_at', 'desc')->get(); $this['active_blog'] = Blog::orderBy('created_at', 'desc')->where('published', 1)->count(); $this['all_blog'] = Blog::orderBy('created_at', 'desc')->count(); } $this['blog'] = Blog::make(); } function onDelete() { $blogId = Input::post('id_blog'); $blog = Blog::find($blogId); if ($blog) { $blog->delete(); } return redirect()->refresh(); } ?> ==
Blog Active

{{active_blog}} {{ (active_blog > 1) ? 'Blogs' : 'Blog'}}

All Blog

{{all_blog}} {{ (all_blog > 1) ? 'Blogs' : 'Blog'}}

List Blog

Add

{% for key, blog in blogs %} {% endfor %}
Title Activity ID Area Published View Created
{{ blog.title }} {{ blog.activity_id }} {{ blog.location.name }} {{ (blog.published == 1) ? 'Yes' : 'No' }} {{ blog.view }} {{ blog.created_at|date('d F Y') }}
{% put scripts %} {% endput %}