@@ -4,8 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use App\Events\GuitarWasCreated; |
6 | 6 | use App\Notification; |
7 | -use Illuminate\Queue\InteractsWithQueue; |
|
8 | -use Illuminate\Contracts\Queue\ShouldQueue; |
|
9 | 7 | |
10 | 8 | class GenerateRackNotification |
11 | 9 | { |
@@ -19,14 +19,14 @@ |
||
19 | 19 | public function handle(GuitarWasCreated $event) |
20 | 20 | { |
21 | 21 | $rack = $event->guitar->rack; |
22 | - if($rack->usage > 90){ |
|
22 | + if ($rack->usage > 90) { |
|
23 | 23 | $rack->makeNotification(Notification::findOrNew([ |
24 | 24 | 'icon' => 'warning', |
25 | 25 | 'link' => '/warehouses', |
26 | 26 | 'message' => "{$rack->name} in {$rack->warehouse->name} is almost full ({$rack->usedd} of {$rack->capacity} used).", |
27 | 27 | ])); |
28 | 28 | } |
29 | - else if($rack->isFull()){ |
|
29 | + else if ($rack->isFull()) { |
|
30 | 30 | $rack->makeNotification(Notification::findOrNew([ |
31 | 31 | 'icon' => 'error', |
32 | 32 | 'link' => '/warehouses', |
@@ -25,8 +25,7 @@ |
||
25 | 25 | 'link' => '/warehouses', |
26 | 26 | 'message' => "{$rack->name} in {$rack->warehouse->name} is almost full ({$rack->usedd} of {$rack->capacity} used).", |
27 | 27 | ])); |
28 | - } |
|
29 | - else if($rack->isFull()){ |
|
28 | + } else if($rack->isFull()){ |
|
30 | 29 | $rack->makeNotification(Notification::findOrNew([ |
31 | 30 | 'icon' => 'error', |
32 | 31 | 'link' => '/warehouses', |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('notifications', function (Blueprint $table) { |
|
15 | + Schema::create('notifications', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('icon')->nullable(); |
18 | 18 | $table->string('link')->nullable(); |
@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public function broadcastOn() |
35 | 35 | { |
36 | - return ['default']; |
|
36 | + return [ 'default' ]; |
|
37 | 37 | } |
38 | 38 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | if ($purchase->hasArrived() && $purchase->isPendingStorage()) { |
21 | 21 | $purchase->makeNotification(Notification::findOrNew([ |
22 | 22 | 'icon' => 'flight_land', |
23 | - 'link' => '/purchases/' . $purchase->id, |
|
23 | + 'link' => '/purchases/'.$purchase->id, |
|
24 | 24 | 'message' => "Purchase of {$purchase->quantity} {$purchase->make->name} has arrived from {$purchase->supplier->name}, {$purchase->supplier->location}.", |
25 | 25 | ])); |
26 | 26 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | 'name' => 'required|string|max:255' |
39 | 39 | ]); |
40 | 40 | |
41 | - $make = Make::create($request->only(['name'])); |
|
41 | + $make = Make::create($request->only([ 'name' ])); |
|
42 | 42 | event(new MakeWasCreated($make)); |
43 | 43 | } |
44 | 44 |
@@ -41,12 +41,12 @@ |
||
41 | 41 | 'photo' => 'required|image', |
42 | 42 | ]); |
43 | 43 | $photo = $request->file('photo'); |
44 | - $fileName = sha1(time() . $photo->getClientOriginalName()) . '.' . $photo->getClientOriginalExtension(); |
|
44 | + $fileName = sha1(time().$photo->getClientOriginalName()).'.'.$photo->getClientOriginalExtension(); |
|
45 | 45 | $photo->move(config('shop.images.path'), $fileName); |
46 | 46 | $model = Model::create($request->only([ |
47 | 47 | 'name', |
48 | 48 | 'make_id' |
49 | - ]) + ['photo' => config('shop.images.dir') . $fileName]); |
|
49 | + ]) + [ 'photo' => config('shop.images.dir').$fileName ]); |
|
50 | 50 | event(new ModelWasCreated($model)); |
51 | 51 | } |
52 | 52 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'location' => 'required|string|max:255', |
40 | 40 | ]); |
41 | 41 | |
42 | - $supplier = Supplier::create($request->only(['name', 'location'])); |
|
42 | + $supplier = Supplier::create($request->only([ 'name', 'location' ])); |
|
43 | 43 | event(new SupplierWasCreated($supplier)); |
44 | 44 | } |
45 | 45 |
@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public function broadcastOn() |
35 | 35 | { |
36 | - return ['default']; |
|
36 | + return [ 'default' ]; |
|
37 | 37 | } |
38 | 38 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public function broadcastOn() |
35 | 35 | { |
36 | - return ['default']; |
|
36 | + return [ 'default' ]; |
|
37 | 37 | } |
38 | 38 | } |