Skip to content

Commit

Permalink
Apply fixes from StyleCI (#512)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
tabuna authored Feb 8, 2018
1 parent 6710eb0 commit d40a24b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions resources/assets/js/components/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ document.addEventListener('turbolinks:load', function() {
$('#menuEdit').modal('hide');
menu.send();
},
destroy: function (id) {
axios
.delete(dashboard.prefix('/systems/menu/' + id))
.then(function(response) {});
destroy: function(id) {
axios
.delete(dashboard.prefix('/systems/menu/' + id))
.then(function(response) {});
},
remove: function() {
$('li[data-id=' + this.id + ']').remove();
Expand Down
4 changes: 2 additions & 2 deletions routes/dashboard/systems.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@

$router->resource('menu', 'MenuController', [
'only' => [
'index', 'show', 'update', 'destroy'
'index', 'show', 'update', 'destroy',
],
'names' => [
'index' => 'dashboard.systems.menu.index',
'show' => 'dashboard.systems.menu.show',
'update' => 'dashboard.systems.menu.update',
'destroy' => 'dashboard.systems.menu.destroy'
'destroy' => 'dashboard.systems.menu.destroy',
],
]);

Expand Down
6 changes: 2 additions & 4 deletions src/Platform/Core/Traits/SimpleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@

trait SimpleSearch
{

/**
* @param $column
* @param null $query
* @return mixed
*/
public function simpleSearchByColumn($column,$query = null){

public function simpleSearchByColumn($column, $query = null)
{
if (self::getQuery()->getConnection() instanceof PostgresConnection) {
return self::whereRaw("{$column}::TEXT ILIKE ?", "%{$query}%");
}

return self::where($column, 'LIKE', "%{$query}%");
}

}
6 changes: 3 additions & 3 deletions src/Platform/Http/Controllers/Systems/MenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ private function createMenuElement(array $items, $parent = 0)
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function destroy(Menu $menu){
Menu::where('parent',$menu->id)->delete();
public function destroy(Menu $menu)
{
Menu::where('parent', $menu->id)->delete();
$menu->delete();

return response()->json([
'type' => 'success',
]);
}

}

0 comments on commit d40a24b

Please sign in to comment.