This commit is contained in:
Manish Verma
2016-12-13 18:18:25 +05:30
parent fc98add11c
commit 2d8e640e9b
2314 changed files with 97798 additions and 75664 deletions

View File

@@ -65,7 +65,7 @@ class ArticleController extends Controller
$article = new Article();
$articles = $article
->select('id', 'name', 'description', 'publish_time', 'slug')
->orderBy('publish_time', 'desc')
->orderBy('publish_time','desc')
->get();
// returns chumper datatable
return Datatable::Collection($articles)

View File

@@ -77,7 +77,6 @@ class CategoryController extends Controller
/* add column name */
->addColumn('name', function ($model) {
$string = strip_tags($model->name);
return str_limit($string, 20);
})
/* add column Created */
@@ -121,7 +120,7 @@ class CategoryController extends Controller
public function create(Category $category)
{
/* Get the all attributes in the category model */
$category = $category->lists('name', 'id')->toArray();
$category = $category->lists('name','id')->toArray();
/* get the view page to create new category with all attributes
of category model */
try {
@@ -148,7 +147,6 @@ class CategoryController extends Controller
// send success message to index page
try {
$category->fill($request->input())->save();
return Redirect::back()->with('success', Lang::get('lang.category_inserted_successfully'));
} catch (Exception $e) {
return Redirect::back()->with('fails', Lang::get('lang.category_not_inserted').'<li>'.$e->getMessage().'</li>');
@@ -167,9 +165,9 @@ class CategoryController extends Controller
{
/* get the atributes of the category model whose id == $id */
$category = Category::whereId($id)->first();
$categories = Category::lists('name', 'id')->toArray();
$categories = Category::lists('name','id')->toArray();
/* get the Edit page the selected category via id */
return view('themes.default1.agent.kb.category.edit', compact('category', 'categories'));
return view('themes.default1.agent.kb.category.edit', compact('category','categories'));
}
/**
@@ -193,7 +191,6 @@ class CategoryController extends Controller
try {
$category->slug = $slug;
$category->fill($request->input())->save();
return redirect('category')->with('success', Lang::get('lang.category_updated_successfully'));
} catch (Exception $e) {
//redirect to index with fails message

View File

@@ -144,13 +144,11 @@ class SettingsController extends Controller
$name = "<p>$model->name</p><br>";
$email = "<p>$model->email</p><br>";
$website = "<p>$model->website</p><br>";
return $name.$email.$website;
})
->addColumn('comment', function ($model) {
$created = TicketController::usertimezone(date($model->created_at));
$created = TicketController::usertimezone(date($model->created_at));
return $model->comment."<p>$created</p>";
})
->addColumn('status', function ($model) {
@@ -161,7 +159,7 @@ class SettingsController extends Controller
return '<p style="color:red"">'.\Lang::get('lang.not_published');
}
})
->addColumn('Actions', function ($model) {
return '<div class="row"><div class="col-md-12"><a href=comment/delete/'.$model->id.' class="btn btn-danger btn-xs">'.\Lang::get('lang.delete').'</a></div><div class="col-md-12"><a href=published/'.$model->id.' class="btn btn-warning btn-xs">'.\Lang::get('lang.publish').'</a></div></div>';
})