@@ -128,7 +128,7 @@ |
||
| 128 | 128 | /** |
| 129 | 129 | * Verify the status. |
| 130 | 130 | * |
| 131 | - * @param $status |
|
| 131 | + * @param string $status |
|
| 132 | 132 | * |
| 133 | 133 | * @return bool |
| 134 | 134 | */ |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @var array |
| 61 | 61 | */ |
| 62 | - protected $guarded = []; |
|
| 62 | + protected $guarded = [ ]; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Date mutators. |
| 66 | 66 | * |
| 67 | 67 | * @var array |
| 68 | 68 | */ |
| 69 | - protected $dates = ['date_purchased', 'delivery_date', 'deleted_at']; |
|
| 69 | + protected $dates = [ 'date_purchased', 'delivery_date', 'deleted_at' ]; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Default date format. |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | parent::boot(); |
| 81 | 81 | |
| 82 | - static::deleting(function (Purchase $purchase) { |
|
| 82 | + static::deleting(function(Purchase $purchase) { |
|
| 83 | 83 | $purchase->guitars()->delete(); |
| 84 | 84 | $purchase->notifications()->delete(); |
| 85 | 85 | }); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($this->delivery_date->isFuture()) { |
| 132 | 132 | return self::UPCOMING; |
| 133 | 133 | } |
| 134 | - if ( ! $this->isPendingStorage()) { |
|
| 134 | + if (!$this->isPendingStorage()) { |
|
| 135 | 135 | return self::COMPLETED; |
| 136 | 136 | } |
| 137 | 137 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | { |
| 249 | 249 | $notification = $this->notifications()->create([ |
| 250 | 250 | 'icon' => 'flight_land', |
| 251 | - 'link' => '/purchases/' . $this->id, |
|
| 251 | + 'link' => '/purchases/'.$this->id, |
|
| 252 | 252 | 'message' => "Purchase of {$this->quantity} {$this->make->name} has arrived from {$this->supplier->name}, {$this->supplier->location}.", |
| 253 | 253 | ]); |
| 254 | 254 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * |
| 42 | 42 | * @param Rack $rack |
| 43 | 43 | * |
| 44 | - * @return \League\Fractal\Resource\Collection |
|
| 44 | + * @return \League\Fractal\Resource\Item |
|
| 45 | 45 | */ |
| 46 | 46 | public function includeWarehouse(Rack $rack) |
| 47 | 47 | { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['warehouse', 'guitars']; |
|
| 15 | + protected $availableIncludes = [ 'warehouse', 'guitars' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | public function transform(Rack $rack) |
| 25 | 25 | { |
| 26 | 26 | return [ |
| 27 | - 'id' => (int)$rack->id, |
|
| 28 | - 'name' => (string)$rack->name, |
|
| 29 | - 'capacity' => (int)$rack->capacity, |
|
| 30 | - 'used' => (int)$rack->used, |
|
| 31 | - 'usage' => (float)$rack->usage, |
|
| 32 | - 'make_id' => (int)$rack->make_id, |
|
| 27 | + 'id' => (int) $rack->id, |
|
| 28 | + 'name' => (string) $rack->name, |
|
| 29 | + 'capacity' => (int) $rack->capacity, |
|
| 30 | + 'used' => (int) $rack->used, |
|
| 31 | + 'usage' => (float) $rack->usage, |
|
| 32 | + 'make_id' => (int) $rack->make_id, |
|
| 33 | 33 | 'make' => [ |
| 34 | - 'id' => (int)$rack->make->id, |
|
| 35 | - 'name' => (string)$rack->make->name, |
|
| 34 | + 'id' => (int) $rack->make->id, |
|
| 35 | + 'name' => (string) $rack->make->name, |
|
| 36 | 36 | ], |
| 37 | 37 | ]; |
| 38 | 38 | } |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct() |
| 24 | 24 | { |
| 25 | - $this->middleware('guest', ['except' => 'logout']); |
|
| 25 | + $this->middleware('guest', [ 'except' => 'logout' ]); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function map(Router $router) |
| 39 | 39 | { |
| 40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 40 | + $router->group([ 'namespace' => $this->namespace ], function($router) { |
|
| 41 | 41 | require app_path('Http/routes.php'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['guitars']; |
|
| 15 | + protected $availableIncludes = [ 'guitars' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['racks', 'models', 'purchases', 'guitars']; |
|
| 15 | + protected $availableIncludes = [ 'racks', 'models', 'purchases', 'guitars' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['sales']; |
|
| 15 | + protected $availableIncludes = [ 'sales' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * |
| 42 | 42 | * @param Rack $rack |
| 43 | 43 | * |
| 44 | - * @return \League\Fractal\Resource\Collection |
|
| 44 | + * @return \League\Fractal\Resource\Item |
|
| 45 | 45 | */ |
| 46 | 46 | public function includeWarehouse(Rack $rack) |
| 47 | 47 | { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['supplier', 'guitars']; |
|
| 15 | + protected $availableIncludes = [ 'supplier', 'guitars' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -24,27 +24,27 @@ discard block |
||
| 24 | 24 | public function transform(Purchase $purchase) |
| 25 | 25 | { |
| 26 | 26 | return [ |
| 27 | - 'id' => (int)$purchase->id, |
|
| 28 | - 'supplier_id' => (int)$purchase->supplier_id, |
|
| 29 | - 'quantity' => (int)$purchase->quantity, |
|
| 30 | - 'price' => (float)$purchase->price, |
|
| 31 | - 'stored' => (int)$purchase->stored, |
|
| 32 | - 'sold' => (int)$purchase->sold, |
|
| 27 | + 'id' => (int) $purchase->id, |
|
| 28 | + 'supplier_id' => (int) $purchase->supplier_id, |
|
| 29 | + 'quantity' => (int) $purchase->quantity, |
|
| 30 | + 'price' => (float) $purchase->price, |
|
| 31 | + 'stored' => (int) $purchase->stored, |
|
| 32 | + 'sold' => (int) $purchase->sold, |
|
| 33 | 33 | 'make' => [ |
| 34 | - 'id' => (int)$purchase->make->id, |
|
| 35 | - 'name' => (string)$purchase->make->name, |
|
| 34 | + 'id' => (int) $purchase->make->id, |
|
| 35 | + 'name' => (string) $purchase->make->name, |
|
| 36 | 36 | ], |
| 37 | 37 | 'purchased' => [ |
| 38 | 38 | 'timestamp' => $purchase->date_purchased->getTimestamp(), |
| 39 | - 'date' => (string)$purchase->date_purchased->toFormattedDateString(), |
|
| 40 | - 'readable' => (string)$purchase->date_purchased->diffForHumans(), |
|
| 39 | + 'date' => (string) $purchase->date_purchased->toFormattedDateString(), |
|
| 40 | + 'readable' => (string) $purchase->date_purchased->diffForHumans(), |
|
| 41 | 41 | ], |
| 42 | 42 | 'delivery' => [ |
| 43 | 43 | 'timestamp' => $purchase->delivery_date->getTimestamp(), |
| 44 | - 'date' => (string)$purchase->delivery_date->toFormattedDateString(), |
|
| 45 | - 'readable' => (string)$purchase->delivery_date->diffForHumans(), |
|
| 44 | + 'date' => (string) $purchase->delivery_date->toFormattedDateString(), |
|
| 45 | + 'readable' => (string) $purchase->delivery_date->diffForHumans(), |
|
| 46 | 46 | ], |
| 47 | - 'status' => (string)$purchase->status, |
|
| 47 | + 'status' => (string) $purchase->status, |
|
| 48 | 48 | ]; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $this->validate($request, [ |
| 40 | 40 | 'name' => 'required|max:255', |
| 41 | - 'email' => 'required|email|unique:users,email,' . Auth::id(), |
|
| 41 | + 'email' => 'required|email|unique:users,email,'.Auth::id(), |
|
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | 44 | Auth::user()->fill($request->all())->save(); |