Apply fixes from StyleCI
This commit is contained in:

committed by
RafficMohammed

parent
ac7fc33df2
commit
e8f61f16d5
@@ -68,6 +68,7 @@ class ArticleController extends Controller
|
||||
->select('id', 'name', 'description', 'publish_time', 'slug')
|
||||
->orderBy('publish_time', 'desc')
|
||||
->get();
|
||||
|
||||
// returns chumper datatable
|
||||
return Datatable::Collection($articles)
|
||||
|
||||
@@ -136,6 +137,7 @@ class ArticleController extends Controller
|
||||
{
|
||||
/* get the attributes of the category */
|
||||
$category = $category->pluck('id', 'name');
|
||||
|
||||
/* get the create page */
|
||||
try {
|
||||
return view('themes.default1.agent.kb.article.create', compact('category'));
|
||||
@@ -169,6 +171,7 @@ class ArticleController extends Controller
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
|
||||
/* insert the values to the article table */
|
||||
try {
|
||||
$article->fill($request->except('slug'))->save();
|
||||
@@ -203,6 +206,7 @@ class ArticleController extends Controller
|
||||
/* get the selected article and display it at edit page */
|
||||
/* Get the selected article with id */
|
||||
$article = $article->whereId($id)->first();
|
||||
|
||||
/* send to the edit page */
|
||||
try {
|
||||
return view('themes.default1.agent.kb.article.edit', compact('assign', 'article', 'category'));
|
||||
@@ -244,6 +248,7 @@ class ArticleController extends Controller
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
|
||||
/* update the value to the table */
|
||||
try {
|
||||
$article->fill($request->all())->save();
|
||||
|
@@ -123,6 +123,7 @@ class CategoryController extends Controller
|
||||
{
|
||||
/* Get the all attributes in the category model */
|
||||
$category = $category->pluck('name', 'id')->toArray();
|
||||
|
||||
/* get the view page to create new category with all attributes
|
||||
of category model */
|
||||
try {
|
||||
@@ -146,6 +147,7 @@ class CategoryController extends Controller
|
||||
$sl = $request->input('name');
|
||||
$slug = Str::slug($sl, '-');
|
||||
$category->slug = $slug;
|
||||
|
||||
// send success message to index page
|
||||
try {
|
||||
$category->fill($request->input())->save();
|
||||
@@ -169,6 +171,7 @@ class CategoryController extends Controller
|
||||
/* get the atributes of the category model whose id == $id */
|
||||
$category = Category::whereId($id)->first();
|
||||
$categories = Category::pluck('name', 'id')->toArray();
|
||||
|
||||
/* get the Edit page the selected category via id */
|
||||
return view('themes.default1.agent.kb.category.edit', compact('category', 'categories'));
|
||||
}
|
||||
@@ -188,6 +191,7 @@ class CategoryController extends Controller
|
||||
$category = Category::where('id', $id)->first();
|
||||
$sl = $request->input('name');
|
||||
$slug = Str::slug($sl, '-');
|
||||
|
||||
/* update the values at the table via model according with the request */
|
||||
//redirct to index page with success message
|
||||
try {
|
||||
@@ -218,6 +222,7 @@ class CategoryController extends Controller
|
||||
} else {
|
||||
/* delete the category selected, id == $id */
|
||||
$category = $category->whereId($id)->first();
|
||||
|
||||
// redirect to index with success message
|
||||
try {
|
||||
$category->delete();
|
||||
|
@@ -56,6 +56,7 @@ class SettingsController extends Controller
|
||||
/* get the setting where the id == 1 */
|
||||
$settings = $settings->whereId('1')->first();
|
||||
$time = $time->get();
|
||||
|
||||
//$date = $date->get();
|
||||
return view('themes.default1.agent.kb.settings.settings', compact('date', 'settings', 'time'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user