@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | if (!Schema::hasTable('forum_categories')) { |
| 11 | - Schema::create('forum_categories', function ($table) { |
|
| 11 | + Schema::create('forum_categories', function($table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | $table->string('name'); |
| 14 | 14 | $table->timestamps(); |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | $table->string('body', 4000); |
| 15 | 15 | $table->integer('forum_id')->unsigned(); |
| 16 | 16 | $table->foreign('forum_id') |
| 17 | - ->references('id')->on('forums') |
|
| 18 | - ->onDelete('cascade'); |
|
| 17 | + ->references('id')->on('forums') |
|
| 18 | + ->onDelete('cascade'); |
|
| 19 | 19 | $table->integer('author_id'); |
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | }); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | if (!Schema::hasTable('forum_posts')) { |
| 11 | - Schema::create('forum_posts', function ($table) { |
|
| 11 | + Schema::create('forum_posts', function($table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | $table->string('title'); |
| 14 | 14 | $table->string('body', 4000); |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | $table->string('description')->nullable(); |
| 15 | 15 | $table->integer('category_id')->unsigned(); |
| 16 | 16 | $table->foreign('category_id') |
| 17 | - ->references('id')->on('forum_categories') |
|
| 18 | - ->onDelete('cascade'); |
|
| 17 | + ->references('id')->on('forum_categories') |
|
| 18 | + ->onDelete('cascade'); |
|
| 19 | 19 | $table->integer('public')->default(1); |
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | }); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | if (!Schema::hasTable('forums')) { |
| 11 | - Schema::create('forums', function ($table) { |
|
| 11 | + Schema::create('forums', function($table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | $table->string('name'); |
| 14 | 14 | $table->string('description')->nullable(); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | @endif |
| 36 | 36 | } |
| 37 | 37 | </script> |
| 38 | -<div class="modal fade" id="<?=$modal_id;?>" tabindex="-1" role="dialog" aria-hidden="true"> |
|
| 38 | +<div class="modal fade" id="<?=$modal_id; ?>" tabindex="-1" role="dialog" aria-hidden="true"> |
|
| 39 | 39 | <div class="modal-dialog"> |
| 40 | 40 | <div class="modal-content"> |
| 41 | 41 | <div class="modal-header"> |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | @if(in_array($f['type'], ['text', 'url', 'date', 'datetime', 'time', 'email', 'number'])) |
| 56 | 56 | <div class="input-group"> |
| 57 | 57 | <label class="label" for="{{ $f['name'] }}">{{ $f['label'] or ucfirst($f['name']) }}</label> |
| 58 | - <input class="form-control" id="{{ $f['name'] }}" <?php if(isset($f['value'])) { echo 'value="'. $f['value'] .'" '; } ?>type="{{ $f['type'] }}" placeholder="{{ $f['name'] }}" <?php if(isset($f['required']) && $f['required']) { echo 'required'; } ?> /> |
|
| 58 | + <input class="form-control" id="{{ $f['name'] }}" <?php if (isset($f[ 'value' ])) { echo 'value="'.$f[ 'value' ].'" '; } ?>type="{{ $f['type'] }}" placeholder="{{ $f['name'] }}" <?php if (isset($f[ 'required' ]) && $f[ 'required' ]) { echo 'required'; } ?> /> |
|
| 59 | 59 | </div> |
| 60 | 60 | @elseif(in_array($f['type'], ['select'])) |
| 61 | 61 | <div class="input-group"> |
| 62 | 62 | <label class="label" for="{{ $f['name'] }}">{{ $f['label'] or ucfirst($f['name']) }}</label> |
| 63 | 63 | <select id="{{ $f['name'] }}" class="form-control"> |
| 64 | - <?php $optionField = $f['field']; |
|
| 64 | + <?php $optionField = $f[ 'field' ]; |
|
| 65 | 65 | if (strpos($optionField, '.') !== false) { |
| 66 | 66 | $optionFields = explode('.', $optionField); |
| 67 | 67 | } |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | $replyCount = count($post->replies); |
| 34 | 34 | $lastReply = $post->lastReply(); |
| 35 | 35 | if (isset($lastReply)) { |
| 36 | - $replyAuthor = $lastReply['author']; |
|
| 37 | - $replyDate = $lastReply['date']; |
|
| 36 | + $replyAuthor = $lastReply[ 'author' ]; |
|
| 37 | + $replyDate = $lastReply[ 'date' ]; |
|
| 38 | 38 | } |
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
@@ -2,20 +2,20 @@ |
||
| 2 | 2 | |
| 3 | 3 | @section('breadcrumbs') |
| 4 | 4 | <?php |
| 5 | - $postCounts = []; |
|
| 5 | + $postCounts = [ ]; |
|
| 6 | 6 | |
| 7 | 7 | /* Add Post Authors post count to postCounts array */ |
| 8 | - $postCounts[$post->author->id] = $userHelper->getPostCount($post->author->id); |
|
| 8 | + $postCounts[ $post->author->id ] = $userHelper->getPostCount($post->author->id); |
|
| 9 | 9 | |
| 10 | 10 | $forum = $post->forum; |
| 11 | 11 | $body = $sanitizer->sanitize($post->body); |
| 12 | 12 | $sticky = (bool)$post->sticky; |
| 13 | 13 | $locked = (bool)$post->locked; |
| 14 | 14 | if ($locked) { |
| 15 | - $title = 'Locked: ' . $post->title; |
|
| 15 | + $title = 'Locked: '.$post->title; |
|
| 16 | 16 | } else { |
| 17 | 17 | if ($sticky) { |
| 18 | - $title = 'Sticky: ' . $post->title; |
|
| 18 | + $title = 'Sticky: '.$post->title; |
|
| 19 | 19 | } else { |
| 20 | 20 | $title = $post->title; |
| 21 | 21 | } |
@@ -6,28 +6,28 @@ |
||
| 6 | 6 | $widgets = [ |
| 7 | 7 | |
| 8 | 8 | 'forum' => [ |
| 9 | - 'count' => $counts['forum'], |
|
| 9 | + 'count' => $counts[ 'forum' ], |
|
| 10 | 10 | 'class' => 'bg-info', |
| 11 | 11 | 'title' => 'Forums', |
| 12 | 12 | 'size' => 2, |
| 13 | 13 | ], |
| 14 | 14 | |
| 15 | 15 | 'category' => [ |
| 16 | - 'count' => $counts['category'], |
|
| 16 | + 'count' => $counts[ 'category' ], |
|
| 17 | 17 | 'class' => 'bg-primary', |
| 18 | 18 | 'title' => 'Categories', |
| 19 | 19 | 'size' => 2, |
| 20 | 20 | ], |
| 21 | 21 | |
| 22 | 22 | 'post' => [ |
| 23 | - 'count' => $counts['post'], |
|
| 23 | + 'count' => $counts[ 'post' ], |
|
| 24 | 24 | 'class' => 'bg-success', |
| 25 | 25 | 'title' => 'Posts', |
| 26 | 26 | 'size' => 2, |
| 27 | 27 | ], |
| 28 | 28 | |
| 29 | 29 | 'reply' => [ |
| 30 | - 'count' => $counts['reply'], |
|
| 30 | + 'count' => $counts[ 'reply' ], |
|
| 31 | 31 | 'class' => 'bg-warning', |
| 32 | 32 | 'title' => 'Replies', |
| 33 | 33 | 'size' => 2, |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | public $table = 'forum_categories'; |
| 16 | 16 | |
| 17 | - public $fillable = ['name']; |
|
| 17 | + public $fillable = [ 'name' ]; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Eloquent Relation. |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public static function valid($data) |
| 34 | 34 | { |
| 35 | 35 | $rules = [ |
| 36 | - 'name' => ['required', 'min:3'], |
|
| 36 | + 'name' => [ 'required', 'min:3' ], |
|
| 37 | 37 | ]; |
| 38 | 38 | $validator = Validator::make($data, $rules); |
| 39 | 39 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | public $table = 'forum_posts'; |
| 23 | 23 | |
| 24 | - public $fillable = ['title', 'body', 'forum_id', 'author_id', 'sticky', 'locked']; |
|
| 24 | + public $fillable = [ 'title', 'body', 'forum_id', 'author_id', 'sticky', 'locked' ]; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Eloquent Relation. |