@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function up() |
| 13 | 13 | { |
| 14 | - Schema::create('block__blocks', function (Blueprint $table) { |
|
| 14 | + Schema::create('block__blocks', function(Blueprint $table) { |
|
| 15 | 15 | $table->engine = 'InnoDB'; |
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name'); |
| 18 | 18 | $table->timestamps(); |
| 19 | 19 | }); |
| 20 | 20 | |
| 21 | - Schema::create('block__blocks_translations', function (Blueprint $table) { |
|
| 21 | + Schema::create('block__blocks_translations', function(Blueprint $table) { |
|
| 22 | 22 | $table->engine = 'InnoDB'; |
| 23 | 23 | $table->increments('id'); |
| 24 | 24 | $table->tinyInteger('online')->nullable(); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $table->integer('block_id')->unsigned(); |
| 28 | 28 | $table->string('locale')->index(); |
| 29 | - $table->unique(['block_id', 'locale']); |
|
| 29 | + $table->unique([ 'block_id', 'locale' ]); |
|
| 30 | 30 | $table->foreign('block_id')->references('id')->on('block__blocks')->onDelete('cascade'); |
| 31 | 31 | }); |
| 32 | 32 | } |
@@ -5,6 +5,6 @@ |
||
| 5 | 5 | class BlockTranslation extends Model |
| 6 | 6 | { |
| 7 | 7 | public $timestamps = false; |
| 8 | - protected $fillable = ['online', 'body']; |
|
| 8 | + protected $fillable = [ 'online', 'body' ]; |
|
| 9 | 9 | protected $table = 'block__blocks_translations'; |
| 10 | 10 | } |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function messages() |
| 34 | 34 | { |
| 35 | - return []; |
|
| 35 | + return [ ]; |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -29,8 +29,8 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function extendWith(Menu $menu) |
| 31 | 31 | { |
| 32 | - $menu->group(trans('core::sidebar.content'), function (Group $group) { |
|
| 33 | - $group->item(trans('block::blocks.title.blocks'), function (Item $item) { |
|
| 32 | + $menu->group(trans('core::sidebar.content'), function(Group $group) { |
|
| 33 | + $group->item(trans('block::blocks.title.blocks'), function(Item $item) { |
|
| 34 | 34 | $item->authorize( |
| 35 | 35 | $this->auth->hasAccess('block.blocks.index') |
| 36 | 36 | ); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** @test */ |
| 10 | 10 | public function it_creates_blocks() |
| 11 | 11 | { |
| 12 | - $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]); |
|
| 12 | + $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en' ], 'fr' => [ 'body' => 'lorem fr' ] ]); |
|
| 13 | 13 | $blocks = $this->block->all(); |
| 14 | 14 | |
| 15 | 15 | $this->assertCount(1, $blocks); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** @test */ |
| 39 | 39 | public function it_gets_block_by_name() |
| 40 | 40 | { |
| 41 | - $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => true]]); |
|
| 41 | + $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => true ] ]); |
|
| 42 | 42 | $this->createRandomBlock(true, true); |
| 43 | 43 | $this->createRandomBlock(true, true); |
| 44 | 44 | $this->createRandomBlock(true, true); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** @test */ |
| 52 | 52 | public function it_gets_block_by_name_if_online() |
| 53 | 53 | { |
| 54 | - $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 54 | + $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 55 | 55 | $this->createRandomBlock(true, true); |
| 56 | 56 | $this->createRandomBlock(true, true); |
| 57 | 57 | $this->createRandomBlock(true, true); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** @test */ |
| 69 | 69 | public function it_gets_block_by_facade() |
| 70 | 70 | { |
| 71 | - $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 71 | + $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 72 | 72 | $this->createRandomBlock(true, true); |
| 73 | 73 | $this->createRandomBlock(true, true); |
| 74 | 74 | |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | /** @test */ |
| 81 | 81 | public function it_slugifies_the_name_property() |
| 82 | 82 | { |
| 83 | - $block = $this->block->create(['name' => 'test block', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 83 | + $block = $this->block->create([ 'name' => 'test block', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 84 | 84 | |
| 85 | 85 | $this->assertEquals('test-block', $block->name); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function it_makes_name_unique() |
| 89 | 89 | { |
| 90 | - $this->block->create(['name' => 'test block']); |
|
| 91 | - $block = $this->block->create(['name' => 'test block']); |
|
| 90 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 91 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 92 | 92 | |
| 93 | 93 | $this->assertEquals('test-block-1', $block->name); |
| 94 | 94 | } |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | /** @test */ |
| 97 | 97 | public function it_increments_name_if_not_unique() |
| 98 | 98 | { |
| 99 | - $this->block->create(['name' => 'test block']); |
|
| 100 | - $this->block->create(['name' => 'test block']); |
|
| 101 | - $block1 = $this->block->create(['name' => 'test block']); |
|
| 102 | - $block2 = $this->block->create(['name' => 'test block']); |
|
| 99 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 100 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 101 | + $block1 = $this->block->create([ 'name' => 'test block' ]); |
|
| 102 | + $block2 = $this->block->create([ 'name' => 'test block' ]); |
|
| 103 | 103 | |
| 104 | 104 | $this->assertEquals('test-block-2', $block1->name); |
| 105 | 105 | $this->assertEquals('test-block-3', $block2->name); |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | /** @test */ |
| 109 | 109 | public function it_updates_block_without_name_change() |
| 110 | 110 | { |
| 111 | - $block = $this->block->create(['name' => 'test block']); |
|
| 112 | - $this->block->update($block, ['name' => 'test-block']); |
|
| 111 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 112 | + $this->block->update($block, [ 'name' => 'test-block' ]); |
|
| 113 | 113 | |
| 114 | 114 | $this->assertEquals($block->name, 'test-block'); |
| 115 | 115 | } |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | /** @test */ |
| 118 | 118 | public function it_updates_block_with_name_change() |
| 119 | 119 | { |
| 120 | - $block = $this->block->create(['name' => 'test block']); |
|
| 121 | - $this->block->update($block, ['name' => 'my awesome block']); |
|
| 120 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 121 | + $this->block->update($block, [ 'name' => 'my awesome block' ]); |
|
| 122 | 122 | |
| 123 | 123 | $this->assertEquals($block->name, 'my-awesome-block'); |
| 124 | 124 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | @include('block::admin.blocks.partials.create-fields', ['lang' => $locale, '']) |
| 30 | 30 | </div> |
| 31 | 31 | <?php endforeach; ?> |
| 32 | - <?php if (config('asgard.block.config.partials.normal.create') !== []): ?> |
|
| 32 | + <?php if (config('asgard.block.config.partials.normal.create') !== [ ]): ?> |
|
| 33 | 33 | <?php foreach (config('asgard.block.config.partials.normal.create') as $partial): ?> |
| 34 | 34 | @include($partial) |
| 35 | 35 | <?php endforeach; ?> |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | {!! Form::i18nCheckbox('online', trans('block::blocks.online'), $errors, $lang) !!} |
| 5 | 5 | |
| 6 | - <?php if (config('asgard.block.config.partials.translatable.create') !== []): ?> |
|
| 6 | + <?php if (config('asgard.block.config.partials.translatable.create') !== [ ]): ?> |
|
| 7 | 7 | <?php foreach (config('asgard.block.config.partials.translatable.create') as $partial): ?> |
| 8 | 8 | @include($partial) |
| 9 | 9 | <?php endforeach; ?> |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | {!! Form::i18nCheckbox('online', trans('block::blocks.online'), $errors, $lang, $block) !!} |
| 5 | 5 | |
| 6 | - <?php if (config('asgard.block.config.partials.translatable.edit') !== []): ?> |
|
| 6 | + <?php if (config('asgard.block.config.partials.translatable.edit') !== [ ]): ?> |
|
| 7 | 7 | <?php foreach (config('asgard.block.config.partials.translatable.edit') as $partial): ?> |
| 8 | 8 | @include($partial) |
| 9 | 9 | <?php endforeach; ?> |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | @include('block::admin.blocks.partials.edit-fields', ['lang' => $locale]) |
| 30 | 30 | </div> |
| 31 | 31 | <?php endforeach; ?> |
| 32 | - <?php if (config('asgard.block.config.partials.normal.edit') !== []): ?> |
|
| 32 | + <?php if (config('asgard.block.config.partials.normal.edit') !== [ ]): ?> |
|
| 33 | 33 | <?php foreach (config('asgard.block.config.partials.normal.edit') as $partial): ?> |
| 34 | 34 | @include($partial) |
| 35 | 35 | <?php endforeach; ?> |