@@ -47,7 +47,7 @@ |
||
47 | 47 | $this->skipLoginCheck = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : []; |
48 | 48 | |
49 | 49 | $this->relations = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false; |
50 | - $route = explode('@',\Route::currentRouteAction())[1]; |
|
50 | + $route = explode('@', \Route::currentRouteAction())[1]; |
|
51 | 51 | $this->checkPermission(explode('_', snake_case($route))[1]); |
52 | 52 | } |
53 | 53 |
@@ -12,11 +12,11 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('settings', function (Blueprint $table) { |
|
15 | + Schema::create('settings', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | - $table->string('name',100); |
|
18 | - $table->string('key',100)->unique(); |
|
19 | - $table->string('value',100); |
|
17 | + $table->string('name', 100); |
|
18 | + $table->string('key', 100)->unique(); |
|
19 | + $table->string('value', 100); |
|
20 | 20 | $table->softDeletes(); |
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
5 | 5 | |
6 | -class Log extends Model{ |
|
6 | +class Log extends Model { |
|
7 | 7 | |
8 | 8 | use SoftDeletes; |
9 | 9 | protected $table = 'logs'; |
@@ -12,11 +12,11 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('logs', function (Blueprint $table) { |
|
15 | + Schema::create('logs', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | - $table->string('action',100); |
|
18 | - $table->string('item_name',100); |
|
19 | - $table->string('item_type',100); |
|
17 | + $table->string('action', 100); |
|
18 | + $table->string('item_name', 100); |
|
19 | + $table->string('item_type', 100); |
|
20 | 20 | $table->integer('item_id'); |
21 | 21 | $table->integer('user_id'); |
22 | 22 | $table->softDeletes(); |
@@ -12,12 +12,12 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('notifications', function (Blueprint $table) { |
|
15 | + Schema::create('notifications', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | - $table->string('name',100); |
|
17 | + $table->string('name', 100); |
|
18 | 18 | $table->text('description')->nullable(); |
19 | - $table->string('item_name',100); |
|
20 | - $table->string('item_type',100); |
|
19 | + $table->string('item_name', 100); |
|
20 | + $table->string('item_type', 100); |
|
21 | 21 | $table->integer('item_id'); |
22 | 22 | $table->boolean('notified'); |
23 | 23 | $table->softDeletes(); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
5 | 5 | |
6 | -class Notification extends Model{ |
|
6 | +class Notification extends Model { |
|
7 | 7 | |
8 | 8 | use SoftDeletes; |
9 | 9 | protected $table = 'notifications'; |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * @param boolean $user |
24 | 24 | * @return boolean |
25 | 25 | */ |
26 | - public function can($nameOfPermission, $model, $user = false ) |
|
26 | + public function can($nameOfPermission, $model, $user = false) |
|
27 | 27 | { |
28 | 28 | $user = $user ?: \Auth::user(); |
29 | 29 | $permissions = []; |
30 | - \Core::users()->find($user->id, ['groups.permissions'])->groups->lists('permissions')->each(function ($permission) use (&$permissions, $model){ |
|
30 | + \Core::users()->find($user->id, ['groups.permissions'])->groups->lists('permissions')->each(function($permission) use (&$permissions, $model){ |
|
31 | 31 | $permissions = array_merge($permissions, $permission->where('model', $model)->lists('name')->toArray()); |
32 | 32 | }); |
33 | 33 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function assignGroups($user_id, $group_ids) |
57 | 57 | { |
58 | - \DB::transaction(function () use ($user_id, $group_ids) { |
|
58 | + \DB::transaction(function() use ($user_id, $group_ids) { |
|
59 | 59 | $user = \Core::users()->find($user_id); |
60 | 60 | $user->groups()->detach(); |
61 | 61 | $user->groups()->attach($group_ids); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function assignPermissions($group_id, $permission_ids) |
25 | 25 | { |
26 | - \DB::transaction(function () use ($group_id, $permission_ids) { |
|
26 | + \DB::transaction(function() use ($group_id, $permission_ids) { |
|
27 | 27 | $group = \Core::groups()->find($group_id); |
28 | 28 | $group->permissions()->detach(); |
29 | 29 | $group->permissions()->attach($permission_ids); |
@@ -15,8 +15,8 @@ |
||
15 | 15 | |
16 | 16 | $apiVersion = \Request::header('api-version') ?: 1; |
17 | 17 | Route::controllers([ |
18 | - 'users' => class_exists('V' . $apiVersion . '\UsersController') ? 'V' . $apiVersion . '\UsersController' : 'V1\UsersController', |
|
19 | - 'groups' => 'V' . $apiVersion . '\GroupsController', |
|
20 | - 'permissions' => 'V' . $apiVersion . '\PermissionsController' |
|
18 | + 'users' => class_exists('V'.$apiVersion.'\UsersController') ? 'V'.$apiVersion.'\UsersController' : 'V1\UsersController', |
|
19 | + 'groups' => 'V'.$apiVersion.'\GroupsController', |
|
20 | + 'permissions' => 'V'.$apiVersion.'\PermissionsController' |
|
21 | 21 | ]); |
22 | 22 | }); |
23 | 23 | \ No newline at end of file |