@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | public function boot() |
16 | 16 | { |
17 | - $configPath = __DIR__ . '/../../config/laravel-model-caching.php'; |
|
17 | + $configPath = __DIR__.'/../../config/laravel-model-caching.php'; |
|
18 | 18 | $this->mergeConfigFrom($configPath, 'laravel-model-caching'); |
19 | 19 | $this->commands([ |
20 | 20 | Clear::class, |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function register() |
29 | 29 | { |
30 | - if (! class_exists('GeneaLabs\LaravelModelCaching\EloquentBuilder')) { |
|
30 | + if (!class_exists('GeneaLabs\LaravelModelCaching\EloquentBuilder')) { |
|
31 | 31 | class_alias( |
32 | 32 | ModelCaching::builder(), |
33 | 33 | 'GeneaLabs\LaravelModelCaching\EloquentBuilder' |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $beforeBook->title = 'new foo'; |
16 | 16 | $beforeBook->save(); |
17 | 17 | |
18 | - $this->postJson('nova-api/books/' . $beforeBook->id . '/attach/stores' , [ |
|
18 | + $this->postJson('nova-api/books/'.$beforeBook->id.'/attach/stores', [ |
|
19 | 19 | 'stores' => $beforeStore->id, |
20 | 20 | 'viaRelationship' => 'stores' |
21 | 21 | ]); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $beforeBooks = $beforeStore->books; |
48 | 48 | $beforeBook = $beforeBooks->first(); |
49 | 49 | |
50 | - $this->deleteJson('/nova-api/stores/detach?viaResource=books&viaResourceId=' . $beforeBook->id . '&viaRelationship=stores' , [ |
|
50 | + $this->deleteJson('/nova-api/stores/detach?viaResource=books&viaResourceId='.$beforeBook->id.'&viaRelationship=stores', [ |
|
51 | 51 | 'resources' => [$beforeStore->id], |
52 | 52 | ]); |
53 | 53 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $beforeStore = Store::with(['books'])->get()->first(); |
67 | 67 | $beforeBook = $beforeStore->books->first(); |
68 | 68 | |
69 | - $this->putJson('nova-api/books/' . $beforeBook->id, [ |
|
69 | + $this->putJson('nova-api/books/'.$beforeBook->id, [ |
|
70 | 70 | 'title' => 'foo', |
71 | 71 | ]); |
72 | 72 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $beforeAuthors = (new Author)->get(); |
11 | 11 | $author = $beforeAuthors->first(); |
12 | 12 | |
13 | - $this->putJson('nova-api/authors/' . $author->id, [ |
|
13 | + $this->putJson('nova-api/authors/'.$author->id, [ |
|
14 | 14 | 'name' => 'foo', |
15 | 15 | 'email' => '[email protected]', |
16 | 16 | ]); |
@@ -31,20 +31,20 @@ discard block |
||
31 | 31 | |
32 | 32 | $this->setUpBaseLineSqlLiteDatabase(); |
33 | 33 | |
34 | - $databasePath = __DIR__ . "/database"; |
|
34 | + $databasePath = __DIR__."/database"; |
|
35 | 35 | $this->testingSqlitePath = "{$databasePath}/"; |
36 | 36 | $baselinePath = "{$databasePath}/baseline.sqlite"; |
37 | 37 | $testingPath = "{$databasePath}/testing.sqlite"; |
38 | 38 | |
39 | - ! file_exists($testingPath) |
|
39 | + !file_exists($testingPath) |
|
40 | 40 | ?: unlink($testingPath); |
41 | 41 | copy($baselinePath, $testingPath); |
42 | 42 | |
43 | - require(__DIR__ . '/routes/web.php'); |
|
43 | + require(__DIR__.'/routes/web.php'); |
|
44 | 44 | |
45 | - $this->withFactories(__DIR__ . '/database/factories'); |
|
45 | + $this->withFactories(__DIR__.'/database/factories'); |
|
46 | 46 | |
47 | - view()->addLocation(__DIR__ . '/resources/views', 'laravel-model-caching'); |
|
47 | + view()->addLocation(__DIR__.'/resources/views', 'laravel-model-caching'); |
|
48 | 48 | |
49 | 49 | $this->cache = app('cache') |
50 | 50 | ->store(config('laravel-model-caching.store')); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | self::$baseLineDatabaseMigrated = true; |
71 | 71 | |
72 | - $file = __DIR__ . '/database/baseline.sqlite'; |
|
72 | + $file = __DIR__.'/database/baseline.sqlite'; |
|
73 | 73 | $this->app['config']->set('database.default', 'baseline'); |
74 | 74 | $this->app['config']->set('database.connections.baseline', [ |
75 | 75 | 'driver' => 'sqlite', |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | "foreign_key_constraints" => false, |
80 | 80 | ]); |
81 | 81 | |
82 | - ! file_exists($file) |
|
82 | + !file_exists($file) |
|
83 | 83 | ?: unlink($file); |
84 | 84 | touch($file); |
85 | 85 | |
86 | - $this->withFactories(__DIR__ . '/database/factories'); |
|
87 | - $this->loadMigrationsFrom(__DIR__ . '/database/migrations'); |
|
86 | + $this->withFactories(__DIR__.'/database/factories'); |
|
87 | + $this->loadMigrationsFrom(__DIR__.'/database/migrations'); |
|
88 | 88 | |
89 | 89 | Artisan::call('db:seed', [ |
90 | 90 | '--class' => 'DatabaseSeeder', |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $app['config']->set('database.default', 'testing'); |
100 | 100 | $app['config']->set('database.connections.testing', [ |
101 | 101 | 'driver' => 'sqlite', |
102 | - 'database' => __DIR__ . '/database/testing.sqlite', |
|
102 | + 'database' => __DIR__.'/database/testing.sqlite', |
|
103 | 103 | 'prefix' => '', |
104 | 104 | "foreign_key_constraints" => false, |
105 | 105 | ]); |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | "commentable_id" => $post->id, |
43 | 43 | "commentable_type" => Post::class, |
44 | 44 | ]) |
45 | - ->each(function ($comment) { |
|
45 | + ->each(function($comment) { |
|
46 | 46 | (new Comment)->create([ |
47 | 47 | "commentable_id" => $comment->commentable_id, |
48 | 48 | "commentable_type" => UncachedPost::class, |
49 | 49 | "description" => $comment->description, |
50 | - "subject" => $comment->subject . ' - uncached post', |
|
50 | + "subject" => $comment->subject.' - uncached post', |
|
51 | 51 | ]); |
52 | 52 | }); |
53 | 53 | $publishers = factory(Publisher::class, 10)->create(); |
54 | 54 | (new Author)->observe(AuthorObserver::class); |
55 | 55 | factory(Author::class, 10)->create() |
56 | - ->each(function ($author) use ($publishers) { |
|
56 | + ->each(function($author) use ($publishers) { |
|
57 | 57 | $profile = factory(Profile::class) |
58 | 58 | ->make(); |
59 | 59 | $profile->author_id = $author->id; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | "author_id" => $author->id, |
64 | 64 | "publisher_id" => $publishers[rand(0, 9)]->id, |
65 | 65 | ]) |
66 | - ->each(function ($book) use ($author, $publishers) { |
|
66 | + ->each(function($book) use ($author, $publishers) { |
|
67 | 67 | factory(Printer::class)->create([ |
68 | 68 | "book_id" => $book->id, |
69 | 69 | ]); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $bookIds = (new Book)->all()->pluck('id'); |
77 | 77 | factory(Store::class, 10)->create() |
78 | - ->each(function ($store) use ($bookIds) { |
|
78 | + ->each(function($store) use ($bookIds) { |
|
79 | 79 | $store->books()->sync(rand($bookIds->min(), $bookIds->max())); |
80 | 80 | }); |
81 | 81 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Supplier; |
5 | 5 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\User; |
6 | 6 | |
7 | -$factory->define(User::class, function (Faker $faker) { |
|
7 | +$factory->define(User::class, function(Faker $faker) { |
|
8 | 8 | return [ |
9 | 9 | 'name' => $faker->name, |
10 | 10 | "supplier_id" => factory(Supplier::class)->create()->id, |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\History; |
5 | 5 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\User; |
6 | 6 | |
7 | -$factory->define(History::class, function (Faker $faker) { |
|
7 | +$factory->define(History::class, function(Faker $faker) { |
|
8 | 8 | return [ |
9 | 9 | 'name' => $faker->name, |
10 | 10 | "user_id" => factory(User::class)->create()->id, |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\UncachedAuthor; |
5 | 5 | |
6 | -$factory->define(UncachedAuthor::class, function (Faker $faker) { |
|
6 | +$factory->define(UncachedAuthor::class, function(Faker $faker) { |
|
7 | 7 | return [ |
8 | 8 | 'name' => $faker->name, |
9 | 9 | 'email' => $faker->unique()->safeEmail, |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Post; |
5 | 5 | |
6 | -$factory->define(Post::class, function (Faker $faker) { |
|
6 | +$factory->define(Post::class, function(Faker $faker) { |
|
7 | 7 | return [ |
8 | 8 | 'title' => $faker->word, |
9 | 9 | 'body' => $faker->paragraph, |