@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | public $table = 'forums'; |
20 | 20 | |
21 | - public $fillable = ['name', 'description', 'category_id', 'public']; |
|
21 | + public $fillable = [ 'name', 'description', 'category_id', 'public' ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Eloquent Relation. |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | public function getThreadCount() |
46 | 46 | { |
47 | 47 | try { |
48 | - $result = DB::select('SELECT COUNT(*) as count FROM `forum_posts` where forum_id = ?', [$this->id]); |
|
49 | - return $result[0]->count; |
|
48 | + $result = DB::select('SELECT COUNT(*) as count FROM `forum_posts` where forum_id = ?', [ $this->id ]); |
|
49 | + return $result[ 0 ]->count; |
|
50 | 50 | } catch (\Exception $e) { |
51 | 51 | return 0; |
52 | 52 | } |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | { |
32 | 32 | // Publish Config |
33 | 33 | $this->publishes([ |
34 | - __DIR__ . '/../config/laravel-forum.php' => config_path('laravel-forum.php'), |
|
34 | + __DIR__.'/../config/laravel-forum.php' => config_path('laravel-forum.php'), |
|
35 | 35 | ], 'config'); |
36 | 36 | |
37 | 37 | $this->mergeConfigFrom( |
38 | - __DIR__ . '/../config/laravel-forum.php', |
|
38 | + __DIR__.'/../config/laravel-forum.php', |
|
39 | 39 | 'laravel-forum' |
40 | 40 | ); |
41 | 41 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function views() |
56 | 56 | { |
57 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-forum'); |
|
57 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-forum'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function routes() |
64 | 64 | { |
65 | - require __DIR__ . '/Http/routes.php'; |
|
65 | + require __DIR__.'/Http/routes.php'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,6 +70,6 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function migrations() |
72 | 72 | { |
73 | - $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
73 | + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
74 | 74 | } |
75 | 75 | } |
@@ -59,18 +59,18 @@ |
||
59 | 59 | * Builds data required for views. |
60 | 60 | * @return array |
61 | 61 | */ |
62 | - protected function buildData($data = []) |
|
62 | + protected function buildData($data = [ ]) |
|
63 | 63 | { |
64 | 64 | $user = $this->getUser(); |
65 | - $data['user'] = $user; |
|
66 | - $data['layout'] = $this->getLayout(); |
|
67 | - $data['categories'] = ForumCategory::with('forums')->get(); |
|
68 | - $data['sitename'] = $this->getSitename(); |
|
69 | - $data['wysiwyg'] = config('laravel-forum.wysiwyg'); |
|
70 | - $data['sanitizer'] = $this->sanitizer; |
|
71 | - $data['userHelper'] = new UserHelper(); |
|
65 | + $data[ 'user' ] = $user; |
|
66 | + $data[ 'layout' ] = $this->getLayout(); |
|
67 | + $data[ 'categories' ] = ForumCategory::with('forums')->get(); |
|
68 | + $data[ 'sitename' ] = $this->getSitename(); |
|
69 | + $data[ 'wysiwyg' ] = config('laravel-forum.wysiwyg'); |
|
70 | + $data[ 'sanitizer' ] = $this->sanitizer; |
|
71 | + $data[ 'userHelper' ] = new UserHelper(); |
|
72 | 72 | if (Auth::check()) { |
73 | - $data['isAdmin'] = $user->can('create', Forum::class); |
|
73 | + $data[ 'isAdmin' ] = $user->can('create', Forum::class); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $data; |