@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($value > 0) |
39 | 39 | if ($user = Sentinel::findUserById($value)) |
40 | 40 | if ($user != null) |
41 | - return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
|
41 | + return $user->first_name.' '.$user->last_name.' (ID: '.$user->id.')'; |
|
42 | 42 | |
43 | 43 | return $value; |
44 | 44 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($value > 0) |
55 | 55 | if ($user = Sentinel::findUserById($value)) |
56 | 56 | if ($user != null) |
57 | - return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
|
57 | + return $user->first_name.' '.$user->last_name.' (ID: '.$user->id.')'; |
|
58 | 58 | |
59 | 59 | return $value; |
60 | 60 | } |
@@ -35,10 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function getCreatedByAttribute($value) |
37 | 37 | { |
38 | - if ($value > 0) |
|
39 | - if ($user = Sentinel::findUserById($value)) |
|
38 | + if ($value > 0) { |
|
39 | + if ($user = Sentinel::findUserById($value)) |
|
40 | 40 | if ($user != null) |
41 | 41 | return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
42 | + } |
|
42 | 43 | |
43 | 44 | return $value; |
44 | 45 | } |
@@ -51,10 +52,11 @@ discard block |
||
51 | 52 | */ |
52 | 53 | public function getTargetAttribute($value) |
53 | 54 | { |
54 | - if ($value > 0) |
|
55 | - if ($user = Sentinel::findUserById($value)) |
|
55 | + if ($value > 0) { |
|
56 | + if ($user = Sentinel::findUserById($value)) |
|
56 | 57 | if ($user != null) |
57 | 58 | return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
59 | + } |
|
58 | 60 | |
59 | 61 | return $value; |
60 | 62 | } |
@@ -28,13 +28,13 @@ |
||
28 | 28 | $str = explode("* ", $this->description); |
29 | 29 | $choices = array(); |
30 | 30 | |
31 | - foreach($str as $st) |
|
31 | + foreach ($str as $st) |
|
32 | 32 | { |
33 | 33 | preg_match('/(?P<digit>\d+) - (?P<name>\w+)/', $st, $matches); |
34 | 34 | if (sizeof($matches) > 0) { |
35 | - $st = str_replace("*/","",$st); |
|
36 | - $st = str_replace("/*","",$st); |
|
37 | - $choices[$matches[1]] = explode($matches[1] . ' - ', $st)[1]; |
|
35 | + $st = str_replace("*/", "", $st); |
|
36 | + $st = str_replace("/*", "", $st); |
|
37 | + $choices[$matches[1]] = explode($matches[1].' - ', $st)[1]; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | public function up() |
15 | 15 | { |
16 | 16 | |
17 | - Schema::create('User', function (Blueprint $table) { |
|
17 | + Schema::create('User', function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | $table->string('username', 25)->nullable()->unique(); |
20 | 20 | $table->string('password', 60)->nullable(); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | $table->creation(); |
38 | 38 | }); |
39 | 39 | |
40 | - Schema::table('User', function (Blueprint $table) { |
|
40 | + Schema::table('User', function(Blueprint $table) { |
|
41 | 41 | $table->creationRelation(); |
42 | 42 | }); |
43 | 43 | |
44 | - Schema::create('Visits', function (Blueprint $table) { |
|
44 | + Schema::create('Visits', function(Blueprint $table) { |
|
45 | 45 | $table->increments('id'); |
46 | 46 | $table->string('url')->nullable(); |
47 | 47 | $table->string('ip', 15)->nullable(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $table->timestamps(); |
61 | 61 | }); |
62 | 62 | |
63 | - Schema::create('Logs', function (Blueprint $table) { |
|
63 | + Schema::create('Logs', function(Blueprint $table) { |
|
64 | 64 | $table->increments('id'); |
65 | 65 | $table->text('log'); |
66 | 66 | $table->integer('target')->nullable(); |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | $table->creation(); |
70 | 70 | }); |
71 | 71 | |
72 | - Schema::table('Logs', function (Blueprint $table) { |
|
72 | + Schema::table('Logs', function(Blueprint $table) { |
|
73 | 73 | $table->creationRelation(); |
74 | 74 | }); |
75 | 75 | |
76 | - Schema::create('Settings', function (Blueprint $table) { |
|
76 | + Schema::create('Settings', function(Blueprint $table) { |
|
77 | 77 | $table->increments('id'); |
78 | 78 | $table->string('friendly_name', 25); |
79 | 79 | $table->string('name', 25); |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | $table->creation(); |
84 | 84 | }); |
85 | 85 | |
86 | - Schema::table('Settings', function (Blueprint $table) { |
|
86 | + Schema::table('Settings', function(Blueprint $table) { |
|
87 | 87 | $table->creationRelation(); |
88 | 88 | }); |
89 | 89 | |
90 | - Schema::create('Group', function (Blueprint $table) { |
|
90 | + Schema::create('Group', function(Blueprint $table) { |
|
91 | 91 | $table->increments('id'); |
92 | 92 | $table->string('name', 25); |
93 | 93 | $table->string('description', 250)->nullable(); |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | $table->unique('slug'); |
102 | 102 | }); |
103 | 103 | |
104 | - Schema::table('Group', function (Blueprint $table) { |
|
104 | + Schema::table('Group', function(Blueprint $table) { |
|
105 | 105 | $table->creationRelation(); |
106 | 106 | }); |
107 | 107 | |
108 | - Schema::create('Group_User', function (Blueprint $table) { |
|
108 | + Schema::create('Group_User', function(Blueprint $table) { |
|
109 | 109 | $table->increments('id'); |
110 | 110 | $table->integer('user')->unsigned(); |
111 | 111 | $table->integer('group')->unsigned(); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | $table->foreign('group')->references('id')->on('Group'); |
119 | 119 | }); |
120 | 120 | |
121 | - Schema::table('Group_User', function (Blueprint $table) { |
|
121 | + Schema::table('Group_User', function(Blueprint $table) { |
|
122 | 122 | $table->creationRelation(); |
123 | 123 | }); |
124 | 124 | |
125 | - Schema::create('ActivityFeed', function (Blueprint $table) { |
|
125 | + Schema::create('ActivityFeed', function(Blueprint $table) { |
|
126 | 126 | $table->increments('id'); |
127 | 127 | $table->string('added_by', 150); |
128 | 128 | $table->text('activity'); |
@@ -71,8 +71,9 @@ discard block |
||
71 | 71 | ], 'routes'); |
72 | 72 | |
73 | 73 | // Include the routes file |
74 | - if(file_exists(base_path("app/Http/base_routes.php"))) |
|
75 | - include base_path("app/Http/base_routes.php"); |
|
74 | + if(file_exists(base_path("app/Http/base_routes.php"))) { |
|
75 | + include base_path("app/Http/base_routes.php"); |
|
76 | + } |
|
76 | 77 | } |
77 | 78 | |
78 | 79 | /** |
@@ -88,8 +89,9 @@ discard block |
||
88 | 89 | $users = array_get($config, 'models.User'); |
89 | 90 | $model = array_get($config, 'models.Group'); |
90 | 91 | |
91 | - if (class_exists($model) && method_exists($model, 'setUsersModel')) |
|
92 | - forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
92 | + if (class_exists($model) && method_exists($model, 'setUsersModel')) { |
|
93 | + forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
94 | + } |
|
93 | 95 | |
94 | 96 | return new UserRepository($users); |
95 | 97 | }); |
@@ -50,36 +50,36 @@ discard block |
||
50 | 50 | // Publish our views |
51 | 51 | // $this->loadViewsFrom(base_path("resources/views"), 'base'); |
52 | 52 | $this->publishes([ |
53 | - __DIR__ . '/views' => base_path("resources/views") |
|
53 | + __DIR__.'/views' => base_path("resources/views") |
|
54 | 54 | ]); |
55 | 55 | |
56 | 56 | // Publish our lang |
57 | 57 | $this->publishes([ |
58 | - __DIR__ . '/lang' => base_path("resources/lang") |
|
58 | + __DIR__.'/lang' => base_path("resources/lang") |
|
59 | 59 | ]); |
60 | 60 | |
61 | 61 | // Publish our public |
62 | 62 | $this->publishes([ |
63 | - __DIR__ . '/public' => base_path("public") |
|
63 | + __DIR__.'/public' => base_path("public") |
|
64 | 64 | ]); |
65 | 65 | |
66 | 66 | // Publish our migrations |
67 | 67 | $this->publishes([ |
68 | - __DIR__ . '/migrations' => base_path("database/migrations") |
|
68 | + __DIR__.'/migrations' => base_path("database/migrations") |
|
69 | 69 | ], 'migrations'); |
70 | 70 | |
71 | 71 | // Publish a config file |
72 | 72 | $this->publishes([ |
73 | - __DIR__ . '/config' => base_path('/config') |
|
73 | + __DIR__.'/config' => base_path('/config') |
|
74 | 74 | ], 'config'); |
75 | 75 | |
76 | 76 | // Publish our routes |
77 | 77 | $this->publishes([ |
78 | - __DIR__ . '/routes.php' => base_path("app/Http/base_routes.php") |
|
78 | + __DIR__.'/routes.php' => base_path("app/Http/base_routes.php") |
|
79 | 79 | ], 'routes'); |
80 | 80 | |
81 | 81 | // Include the routes file |
82 | - if(file_exists(base_path("app/Http/base_routes.php"))) |
|
82 | + if (file_exists(base_path("app/Http/base_routes.php"))) |
|
83 | 83 | include base_path("app/Http/base_routes.php"); |
84 | 84 | } |
85 | 85 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function registerUsers() |
92 | 92 | { |
93 | - $this->app->singleton('jlourenco.user', function ($app) { |
|
93 | + $this->app->singleton('jlourenco.user', function($app) { |
|
94 | 94 | $config = $app['config']->get('jlourenco.base'); |
95 | 95 | |
96 | 96 | $users = array_get($config, 'models.User'); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | protected function registerGroups() |
112 | 112 | { |
113 | - $this->app->singleton('jlourenco.group', function ($app) { |
|
113 | + $this->app->singleton('jlourenco.group', function($app) { |
|
114 | 114 | $config = $app['config']->get('jlourenco.base'); |
115 | 115 | |
116 | 116 | $model = array_get($config, 'base.models.Group'); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | protected function registerSettings() |
128 | 128 | { |
129 | - $this->app->singleton('jlourenco.settings', function ($app) { |
|
129 | + $this->app->singleton('jlourenco.settings', function($app) { |
|
130 | 130 | $config = $app['config']->get('jlourenco.base'); |
131 | 131 | |
132 | 132 | $model = array_get($config, 'models.Settings'); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | protected function registerLog() |
144 | 144 | { |
145 | - $this->app->singleton('jlourenco.log', function ($app) { |
|
145 | + $this->app->singleton('jlourenco.log', function($app) { |
|
146 | 146 | $config = $app['config']->get('jlourenco.base'); |
147 | 147 | |
148 | 148 | $model = array_get($config, 'models.Logs'); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | protected function registerVisits() |
160 | 160 | { |
161 | - $this->app->singleton('jlourenco.visits', function ($app) { |
|
161 | + $this->app->singleton('jlourenco.visits', function($app) { |
|
162 | 162 | $config = $app['config']->get('jlourenco.base'); |
163 | 163 | |
164 | 164 | $model = array_get($config, 'models.Visits'); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function registerJobs() |
176 | 176 | { |
177 | - $this->app->singleton('jlourenco.jobs', function ($app) { |
|
177 | + $this->app->singleton('jlourenco.jobs', function($app) { |
|
178 | 178 | $config = $app['config']->get('jlourenco.base'); |
179 | 179 | |
180 | 180 | $model = array_get($config, 'models.Jobs'); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | protected function registerBase() |
192 | 192 | { |
193 | - $this->app->singleton('base', function ($app) { |
|
193 | + $this->app->singleton('base', function($app) { |
|
194 | 194 | $base = new Base($app['jlourenco.settings'], $app['jlourenco.user'], $app['jlourenco.log'], $app['jlourenco.visits'], $app['jlourenco.jobs']); |
195 | 195 | |
196 | 196 | return $base; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * All the "restricted area" routes |
7 | 7 | * are defined here. |
8 | 8 | */ |
9 | -Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function () |
|
9 | +Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function() |
|
10 | 10 | { |
11 | 11 | |
12 | 12 | /** |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | /* POST */ Route::post('login', 'jlourenco\base\Controllers\AuthController@postSignin'); |
34 | 34 | |
35 | 35 | /* GET */ Route::get('register', array('as' => 'register', 'uses' => 'jlourenco\base\Controllers\AuthController@getSignup')); |
36 | - /* POST */ Route::post('register', array('as' => 'register','uses' => 'jlourenco\base\Controllers\AuthController@postSignup')); |
|
36 | + /* POST */ Route::post('register', array('as' => 'register', 'uses' => 'jlourenco\base\Controllers\AuthController@postSignup')); |
|
37 | 37 | |
38 | 38 | /* GET */ Route::get('forgot-password', array('as' => 'forgot-password', 'uses' => 'jlourenco\base\Controllers\AuthController@getLostPassword')); |
39 | - /* POST */ Route::post('forgot-password', array('as' => 'forgot-password','uses' => 'jlourenco\base\Controllers\AuthController@postForgotPassword')); |
|
39 | + /* POST */ Route::post('forgot-password', array('as' => 'forgot-password', 'uses' => 'jlourenco\base\Controllers\AuthController@postForgotPassword')); |
|
40 | 40 | |
41 | 41 | # Forgot Password Confirmation |
42 | 42 | Route::get('forgot-password/{userId}/{passwordResetCode}', array('as' => 'forgot-password-confirm', 'uses' => 'jlourenco\base\Controllers\AuthController@getForgotPasswordConfirm')); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | Route::get('activate/{userId}/{activationCode}', array('as' => 'activate', 'uses' => 'jlourenco\base\Controllers\AuthController@getActivate')); |
50 | 50 | |
51 | 51 | # User account |
52 | - Route::group(array('middleware' => 'auth'), function () { |
|
52 | + Route::group(array('middleware' => 'auth'), function() { |
|
53 | 53 | Route::get('profile', array('as' => 'profile', 'uses' => 'jlourenco\base\Controllers\UsersController@myAccount')); |
54 | 54 | Route::post('profile', 'jlourenco\base\Controllers\UsersController@updateAccount'); |
55 | 55 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * All the "restricted area" routes |
72 | 72 | * are defined here. |
73 | 73 | */ |
74 | -Route::group(array('prefix' => '/admin', 'middleware' => ['webAdmin', 'auth']), function () |
|
74 | +Route::group(array('prefix' => '/admin', 'middleware' => ['webAdmin', 'auth']), function() |
|
75 | 75 | { |
76 | 76 | |
77 | 77 | # Dashboard |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /* POST */ Route::post('settings/{id}/edit', array('as' => 'settings.update', 'uses' => 'jlourenco\base\Controllers\SettingsController@update')); |
91 | 91 | |
92 | 92 | # User Management |
93 | - Route::group(array('prefix' => 'users'), function () { |
|
93 | + Route::group(array('prefix' => 'users'), function() { |
|
94 | 94 | Route::get('/list', array('as' => 'users', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminIndex')); |
95 | 95 | Route::get('/pending', array('as' => 'users.pending', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminPending')); |
96 | 96 | Route::get('/blocked', array('as' => 'users.blocked', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminBlocked')); |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | Route::get('/list/{userId}/delete', array('as' => 'delete/user', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminDelete')); |
104 | 104 | Route::get('/list/{userId}/confirm-delete', array('as' => 'confirm-delete/user', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminModalDelete')); |
105 | 105 | Route::get('/list/{userId}/restore', array('as' => 'restore/user', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminRestore')); |
106 | - Route::get('deleted',array('as' => 'users.deleted', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminDeletedUsers')); |
|
106 | + Route::get('deleted', array('as' => 'users.deleted', 'uses' => 'jlourenco\base\Controllers\UsersController@getAdminDeletedUsers')); |
|
107 | 107 | Route::get('/list/{userId}', array('as' => 'users.show', 'uses' => 'jlourenco\base\Controllers\UsersController@adminShow')); |
108 | 108 | }); |
109 | 109 | |
110 | 110 | # Blog Management |
111 | - Route::group(array('prefix' => 'categories'), function () { |
|
111 | + Route::group(array('prefix' => 'categories'), function() { |
|
112 | 112 | Route::get('/list', array('as' => 'blogs', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminIndex')); |
113 | 113 | Route::get('/create', array('as' => 'create/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminCreate')); |
114 | 114 | Route::post('/create', 'jlourenco\blog\Controllers\BlogController@postAdminCreate'); |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | Route::get('{blogId}/delete', array('as' => 'delete/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDelete')); |
118 | 118 | Route::get('{blogId}/confirm-delete', array('as' => 'confirm-delete/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminModalDelete')); |
119 | 119 | Route::get('{blogId}/restore', array('as' => 'restore/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminRestore')); |
120 | - Route::get('deleted',array('as' => 'blogs.deleted', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDeletedBlogs')); |
|
120 | + Route::get('deleted', array('as' => 'blogs.deleted', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDeletedBlogs')); |
|
121 | 121 | Route::get('{blogId}', array('as' => 'blogs.show', 'uses' => 'jlourenco\blog\Controllers\BlogController@adminShow')); |
122 | 122 | }); |
123 | 123 | |
124 | - Route::group(array('prefix' => 'posts'), function () { |
|
124 | + Route::group(array('prefix' => 'posts'), function() { |
|
125 | 125 | Route::get('/list', array('as' => 'blogs', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminIndex')); |
126 | 126 | Route::get('/create', array('as' => 'create/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminCreate')); |
127 | 127 | Route::post('/create', 'jlourenco\blog\Controllers\BlogController@postAdminCreate'); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | Route::get('{blogId}/delete', array('as' => 'delete/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDelete')); |
131 | 131 | Route::get('{blogId}/confirm-delete', array('as' => 'confirm-delete/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminModalDelete')); |
132 | 132 | Route::get('{blogId}/restore', array('as' => 'restore/blog', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminRestore')); |
133 | - Route::get('deleted',array('as' => 'blogs.deleted', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDeletedBlogs')); |
|
133 | + Route::get('deleted', array('as' => 'blogs.deleted', 'uses' => 'jlourenco\blog\Controllers\BlogController@getAdminDeletedBlogs')); |
|
134 | 134 | Route::get('{blogId}', array('as' => 'blogs.show', 'uses' => 'jlourenco\blog\Controllers\BlogController@adminShow')); |
135 | 135 | }); |
136 | 136 |
@@ -20,8 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($model = null) |
22 | 22 | { |
23 | - if (isset($model)) |
|
24 | - $this->model = $model; |
|
23 | + if (isset($model)) { |
|
24 | + $this->model = $model; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
@@ -20,8 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($model = null) |
22 | 22 | { |
23 | - if (isset($model)) |
|
24 | - $this->model = $model; |
|
23 | + if (isset($model)) { |
|
24 | + $this->model = $model; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
@@ -20,8 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($model = null) |
22 | 22 | { |
23 | - if (isset($model)) |
|
24 | - $this->model = $model; |
|
23 | + if (isset($model)) { |
|
24 | + $this->model = $model; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |