@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use Illuminate\Support\Facades\Schema; |
|
4 | -use Illuminate\Database\Schema\Blueprint; |
|
5 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | +use Illuminate\Database\Schema\Blueprint; |
|
5 | +use Illuminate\Support\Facades\Schema; |
|
6 | 6 | |
7 | 7 | class CreateSnippetsVotes extends Migration |
8 | 8 | { |
@@ -20,12 +20,12 @@ |
||
20 | 20 | $table->timestamps(); |
21 | 21 | |
22 | 22 | $table->foreign('user_id') |
23 | - ->references('id')->on('users') |
|
24 | - ->onDelete('cascade'); |
|
23 | + ->references('id')->on('users') |
|
24 | + ->onDelete('cascade'); |
|
25 | 25 | |
26 | 26 | $table->foreign('snippet_id') |
27 | - ->references('id')->on('snippets') |
|
28 | - ->onDelete('cascade'); |
|
27 | + ->references('id')->on('snippets') |
|
28 | + ->onDelete('cascade'); |
|
29 | 29 | }); |
30 | 30 | } |
31 | 31 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('snippets_votes', function (Blueprint $table) { |
|
16 | + Schema::create('snippets_votes', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->unsignedInteger('user_id'); |
19 | 19 | $table->unsignedInteger('snippet_id'); |
@@ -114,6 +114,6 @@ |
||
114 | 114 | | |
115 | 115 | */ |
116 | 116 | |
117 | - 'attributes' => [], |
|
117 | + 'attributes' => [ ], |
|
118 | 118 | |
119 | 119 | ]; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @author Taylor Otwell <[email protected]> |
7 | 7 | */ |
8 | 8 | $uri = urldecode( |
9 | - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
9 | + parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
10 | 10 | ); |
11 | 11 | |
12 | 12 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the |
@@ -13,6 +13,6 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::middleware('auth:api')->get('/user', function (Request $request) { |
|
16 | +Route::middleware('auth:api')->get('/user', function(Request $request) { |
|
17 | 17 | return $request->user(); |
18 | 18 | }); |
@@ -13,6 +13,6 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Artisan::command('inspire', function () { |
|
16 | +Artisan::command('inspire', function() { |
|
17 | 17 | $this->comment(Inspiring::quote()); |
18 | 18 | })->describe('Display an inspiring quote'); |
@@ -11,6 +11,6 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Broadcast::channel('App.User.{id}', function ($user, $id) { |
|
14 | +Broadcast::channel('App.User.{id}', function($user, $id) { |
|
15 | 15 | return (int) $user->id === (int) $id; |
16 | 16 | }); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | /** @var \Illuminate\Database\Eloquent\Factory $factory */ |
15 | -$factory->define(App\User::class, function (Faker\Generator $faker) { |
|
15 | +$factory->define(App\User::class, function(Faker\Generator $faker) { |
|
16 | 16 | static $password; |
17 | 17 | |
18 | 18 | return [ |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | ]; |
25 | 25 | }); |
26 | 26 | |
27 | -$factory->define(App\Snippet::class, function (Faker\Generator $faker) { |
|
27 | +$factory->define(App\Snippet::class, function(Faker\Generator $faker) { |
|
28 | 28 | return [ |
29 | - 'user_id' => function () { |
|
29 | + 'user_id' => function() { |
|
30 | 30 | return factory(App\User::class)->create()->id; |
31 | 31 | }, |
32 | - 'forked_id' => $faker->boolean ? function () { |
|
32 | + 'forked_id' => $faker->boolean ? function() { |
|
33 | 33 | return factory(App\Snippet::class)->create()->id; |
34 | 34 | } |
35 | 35 | : null, |
@@ -109,7 +109,7 @@ |
||
109 | 109 | | |
110 | 110 | */ |
111 | 111 | |
112 | - 'lottery' => [2, 100], |
|
112 | + 'lottery' => [ 2, 100 ], |
|
113 | 113 | |
114 | 114 | /* |
115 | 115 | |-------------------------------------------------------------------------- |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | return response()->json([ |
17 | 17 | 'count' => $snippet->votes->count(), |
18 | - 'favourited' => (bool) count($changes['attached']), |
|
18 | + 'favourited' => (bool) count($changes[ 'attached' ]), |
|
19 | 19 | ]); |
20 | 20 | } |
21 | 21 | } |