@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $authors = (new Author) |
14 | 14 | ->where("id", 1) |
15 | 15 | ->with([ |
16 | - 'books' => function ($query) { |
|
16 | + 'books' => function($query) { |
|
17 | 17 | $query->where("id", "<", 100) |
18 | 18 | ->offset(5) |
19 | 19 | ->limit(1); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | ]) |
22 | 22 | ->first(); |
23 | 23 | $uncachedAuthor = (new UncachedAuthor)->with([ |
24 | - 'books' => function ($query) { |
|
24 | + 'books' => function($query) { |
|
25 | 25 | $query->where("id", "<", 100) |
26 | 26 | ->offset(5) |
27 | 27 | ->limit(1); |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | $author = (new Author) |
39 | 39 | ->where("id", 1) |
40 | 40 | ->with([ |
41 | - 'books' => function ($query) { |
|
41 | + 'books' => function($query) { |
|
42 | 42 | $query->where("id", "<", 100); |
43 | 43 | } |
44 | 44 | ]) |
45 | 45 | ->first(); |
46 | 46 | $uncachedAuthor = (new UncachedAuthor)->with([ |
47 | - 'books' => function ($query) { |
|
47 | + 'books' => function($query) { |
|
48 | 48 | $query->where("id", "<", 100); |
49 | 49 | }, |
50 | 50 | ]) |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | $author = (new Author) |
61 | 61 | ->where("id", 1) |
62 | 62 | ->with([ |
63 | - 'books.publisher' => function ($query) { |
|
63 | + 'books.publisher' => function($query) { |
|
64 | 64 | $query->where("id", "<", 100); |
65 | 65 | } |
66 | 66 | ]) |
67 | 67 | ->first(); |
68 | 68 | $uncachedAuthor = (new UncachedAuthor)->with([ |
69 | - 'books.publisher' => function ($query) { |
|
69 | + 'books.publisher' => function($query) { |
|
70 | 70 | $query->where("id", "<", 100); |
71 | 71 | }, |
72 | 72 | ]) |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | ]; |
15 | 15 | |
16 | 16 | $books = (new Book) |
17 | - ->when(true, function ($query) { |
|
17 | + ->when(true, function($query) { |
|
18 | 18 | $query->where("id", "<", 5); |
19 | 19 | }) |
20 | 20 | ->get(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | ->tags($tags) |
24 | 24 | ->get($key)['value']; |
25 | 25 | $liveResults = (new UncachedBook) |
26 | - ->when(true, function ($query) { |
|
26 | + ->when(true, function($query) { |
|
27 | 27 | $query->where("id", "<", 5); |
28 | 28 | }) |
29 | 29 | ->get(); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | (new Book) |
14 | 14 | ->get() |
15 | - ->each(function ($book) { |
|
15 | + ->each(function($book) { |
|
16 | 16 | $book->image()->create([ |
17 | 17 | "path" => app(Faker::class)->imageUrl(), |
18 | 18 | ]); |
@@ -11,13 +11,13 @@ |
||
11 | 11 | public function testWithQuery() |
12 | 12 | { |
13 | 13 | $books = (new Book) |
14 | - ->where(function ($query) { |
|
14 | + ->where(function($query) { |
|
15 | 15 | $query->where("id", ">", "1") |
16 | 16 | ->where("id", "<", "5"); |
17 | 17 | }) |
18 | 18 | ->get(); |
19 | 19 | $uncachedBooks = (new UncachedBook) |
20 | - ->where(function ($query) { |
|
20 | + ->where(function($query) { |
|
21 | 21 | $query->where("id", ">", "1") |
22 | 22 | ->where("id", "<", "5"); |
23 | 23 | }) |
@@ -15,7 +15,7 @@ |
||
15 | 15 | ->first(); |
16 | 16 | factory(Book::class, 1) |
17 | 17 | ->make() |
18 | - ->each(function ($book) use ($author1) { |
|
18 | + ->each(function($book) use ($author1) { |
|
19 | 19 | $publisher = (new Publisher)->first(); |
20 | 20 | $book->author()->associate($author1); |
21 | 21 | $book->publisher()->associate($publisher); |
@@ -54,13 +54,13 @@ |
||
54 | 54 | public function testWithMultipleMorphModelsWithClosure() |
55 | 55 | { |
56 | 56 | $comments = (new Comment) |
57 | - ->whereHasMorph('commentable', [Post::class, UncachedPost::class], function (Builder $query) { |
|
58 | - return $query->where('subject', 'like', '%uncached post'); |
|
57 | + ->whereHasMorph('commentable', [Post::class, UncachedPost::class], function(Builder $query) { |
|
58 | + return $query->where('subject', 'like', '%uncached post'); |
|
59 | 59 | }) |
60 | 60 | ->get(); |
61 | 61 | $uncachedComments = (new UncachedComment()) |
62 | - ->whereHasMorph('commentable', [Post::class, UncachedPost::class], function (Builder $query) { |
|
63 | - return $query->where('subject', 'like', '%uncached post'); |
|
62 | + ->whereHasMorph('commentable', [Post::class, UncachedPost::class], function(Builder $query) { |
|
63 | + return $query->where('subject', 'like', '%uncached post'); |
|
64 | 64 | }) |
65 | 65 | ->get(); |
66 | 66 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ->whereRaw("name != 'test3'") |
35 | 35 | ->whereRaw('name = ? AND name != ?', [$authorName, "test2"]) |
36 | 36 | ->get(); |
37 | - $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-name_!=_test-_and_name_!=_'test3'-_and_name_=_" . str_replace(" ", "_", $authorName) . "__AND_name_!=_test2-authors.deleted_at_null"); |
|
37 | + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-name_!=_test-_and_name_!=_'test3'-_and_name_=_".str_replace(" ", "_", $authorName)."__AND_name_!=_test2-authors.deleted_at_null"); |
|
38 | 38 | $tags = ["genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor"]; |
39 | 39 | |
40 | 40 | $cachedResults = collect([$this->cache()->tags($tags)->get($key)['value']]); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ]; |
71 | 71 | |
72 | 72 | $authors = (new Author) |
73 | - ->where(function ($query) { |
|
73 | + ->where(function($query) { |
|
74 | 74 | $query->orWhereRaw("id BETWEEN 1 AND 3") |
75 | 75 | ->orWhereRaw("id BETWEEN 5 AND 6"); |
76 | 76 | }) |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | public function testNestedWhereRawWithBindings() |
83 | 83 | { |
84 | 84 | $books = (new Book) |
85 | - ->where(function ($query) { |
|
86 | - $query->whereRaw("title like ? or description like ? or published_at like ? or price like ?", ['%larravel%', '%larravel%', '%larravel%', '%larravel%',]); |
|
85 | + ->where(function($query) { |
|
86 | + $query->whereRaw("title like ? or description like ? or published_at like ? or price like ?", ['%larravel%', '%larravel%', '%larravel%', '%larravel%', ]); |
|
87 | 87 | })->get(); |
88 | 88 | |
89 | 89 | $uncachedBooks = (new UncachedBook) |
90 | - ->where(function ($query) { |
|
91 | - $query->whereRaw("title like ? or description like ? or published_at like ? or price like ?", ['%larravel%', '%larravel%', '%larravel%', '%larravel%',]); |
|
90 | + ->where(function($query) { |
|
91 | + $query->whereRaw("title like ? or description like ? or published_at like ? or price like ?", ['%larravel%', '%larravel%', '%larravel%', '%larravel%', ]); |
|
92 | 92 | })->get(); |
93 | 93 | |
94 | 94 | $this->assertEquals($books->pluck("id"), $uncachedBooks->pluck("id")); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-authors.deleted_at_null"); |
12 | 12 | $tags = ["genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor"]; |
13 | 13 | |
14 | - $authors = app("model-cache")->runDisabled(function () { |
|
14 | + $authors = app("model-cache")->runDisabled(function() { |
|
15 | 15 | return (new Author) |
16 | 16 | ->get(); |
17 | 17 | }); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $books = (new Book) |
112 | 112 | ->with('author') |
113 | - ->whereHas('author', function ($query) { |
|
113 | + ->whereHas('author', function($query) { |
|
114 | 114 | $query->whereId('1'); |
115 | 115 | }) |
116 | 116 | ->get(); |
@@ -134,14 +134,14 @@ discard block |
||
134 | 134 | { |
135 | 135 | $books1 = (new Book) |
136 | 136 | ->with('author') |
137 | - ->whereHas('author', function ($query) { |
|
137 | + ->whereHas('author', function($query) { |
|
138 | 138 | $query->whereId(1); |
139 | 139 | }) |
140 | 140 | ->get() |
141 | 141 | ->keyBy('id'); |
142 | 142 | $books2 = (new Book) |
143 | 143 | ->with('author') |
144 | - ->whereHas('author', function ($query) { |
|
144 | + ->whereHas('author', function($query) { |
|
145 | 145 | $query->whereId(2); |
146 | 146 | }) |
147 | 147 | ->get() |