@@ -78,10 +78,11 @@ |
||
78 | 78 | */ |
79 | 79 | public function getCreatedByAttribute($value) |
80 | 80 | { |
81 | - if ($value > 0) |
|
82 | - if ($user = Sentinel::findUserById($value)) |
|
81 | + if ($value > 0) { |
|
82 | + if ($user = Sentinel::findUserById($value)) |
|
83 | 83 | if ($user != null) |
84 | 84 | return $user; |
85 | + } |
|
85 | 86 | |
86 | 87 | return $value; |
87 | 88 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * All the "restricted area" routes |
7 | 7 | * are defined here. |
8 | 8 | */ |
9 | -Route::group(array('prefix' => '/admin', 'middleware' => ['webAdmin', 'auth']), function () |
|
9 | +Route::group(array('prefix' => '/admin', 'middleware' => ['webAdmin', 'auth']), function() |
|
10 | 10 | { |
11 | 11 | |
12 | 12 | # Delete comments |
@@ -61,7 +61,7 @@ |
||
61 | 61 | return Redirect::route('posts')->with('error', $error); |
62 | 62 | } |
63 | 63 | |
64 | - Base::Log('Comment (' . $comment->id . ') was deleted.'); |
|
64 | + Base::Log('Comment ('.$comment->id.') was deleted.'); |
|
65 | 65 | |
66 | 66 | // Delete the post |
67 | 67 | $comment->delete(); |
@@ -39,26 +39,26 @@ discard block |
||
39 | 39 | // Publish our views |
40 | 40 | $this->loadViewsFrom(base_path("resources/views"), 'base'); |
41 | 41 | $this->publishes([ |
42 | - __DIR__ . '/views' => base_path("resources/views") |
|
42 | + __DIR__.'/views' => base_path("resources/views") |
|
43 | 43 | ]); |
44 | 44 | |
45 | 45 | // Publish our migrations |
46 | 46 | $this->publishes([ |
47 | - __DIR__ . '/migrations' => base_path("database/migrations") |
|
47 | + __DIR__.'/migrations' => base_path("database/migrations") |
|
48 | 48 | ], 'migrations'); |
49 | 49 | |
50 | 50 | // Publish a config file |
51 | 51 | $this->publishes([ |
52 | - __DIR__ . '/config' => base_path('/config') |
|
52 | + __DIR__.'/config' => base_path('/config') |
|
53 | 53 | ], 'config'); |
54 | 54 | |
55 | 55 | // Publish our routes |
56 | 56 | $this->publishes([ |
57 | - __DIR__ . '/routes.php' => base_path("app/Http/comments_routes.php") |
|
57 | + __DIR__.'/routes.php' => base_path("app/Http/comments_routes.php") |
|
58 | 58 | ], 'routes'); |
59 | 59 | |
60 | 60 | // Include the routes file |
61 | - if(file_exists(base_path("app/Http/comments_routes.php"))) |
|
61 | + if (file_exists(base_path("app/Http/comments_routes.php"))) |
|
62 | 62 | include base_path("app/Http/comments_routes.php"); |
63 | 63 | } |
64 | 64 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function registerComment() |
71 | 71 | { |
72 | - $this->app->singleton('jlourenco.comments.comment', function ($app) { |
|
72 | + $this->app->singleton('jlourenco.comments.comment', function($app) { |
|
73 | 73 | $baseConfig = $app['config']->get('jlourenco.base'); |
74 | 74 | $config = $app['config']->get('jlourenco.comments'); |
75 | 75 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function registerComments() |
92 | 92 | { |
93 | - $this->app->singleton('comments', function ($app) { |
|
93 | + $this->app->singleton('comments', function($app) { |
|
94 | 94 | $blog = new Comments($app['jlourenco.comments.comment']); |
95 | 95 | |
96 | 96 | return $blog; |
@@ -58,8 +58,9 @@ discard block |
||
58 | 58 | ], 'routes'); |
59 | 59 | |
60 | 60 | // Include the routes file |
61 | - if(file_exists(base_path("app/Http/comments_routes.php"))) |
|
62 | - include base_path("app/Http/comments_routes.php"); |
|
61 | + if(file_exists(base_path("app/Http/comments_routes.php"))) { |
|
62 | + include base_path("app/Http/comments_routes.php"); |
|
63 | + } |
|
63 | 64 | } |
64 | 65 | |
65 | 66 | /** |
@@ -76,8 +77,9 @@ discard block |
||
76 | 77 | $model = array_get($config, 'models.comment'); |
77 | 78 | $users = array_get($baseConfig, 'models.User'); |
78 | 79 | |
79 | - if (class_exists($model) && method_exists($model, 'setUsersModel')) |
|
80 | - forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
80 | + if (class_exists($model) && method_exists($model, 'setUsersModel')) { |
|
81 | + forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
82 | + } |
|
81 | 83 | |
82 | 84 | return new CommentRepository($model); |
83 | 85 | }); |
@@ -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 | /** |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function up() |
15 | 15 | { |
16 | 16 | |
17 | - Schema::create('Comment', function (Blueprint $table) { |
|
17 | + Schema::create('Comment', function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | $table->integer('parent')->unsigned()->nullable(); |
20 | 20 | $table->text('comment'); |