@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $this->validate($request, $this->rules($request->input('supplier_id'))); |
| 40 | 40 | $purchase = $this->getSupplier($request)->makePurchase( |
| 41 | - $request->only(['id', 'make_id', 'quantity', 'price', 'date_purchased', 'delivery_date']) |
|
| 41 | + $request->only([ 'id', 'make_id', 'quantity', 'price', 'date_purchased', 'delivery_date' ]) |
|
| 42 | 42 | ); |
| 43 | 43 | event(new PurchaseWasCreated($purchase)); |
| 44 | 44 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'supplier.location' => 'required_if:supplier_id,new|string|max:255' |
| 76 | 76 | ]; |
| 77 | 77 | if ($supplierId != 'new') { |
| 78 | - $rules += ['supplier_id' => 'required|integer|exists:suppliers,id']; |
|
| 78 | + $rules += [ 'supplier_id' => 'required|integer|exists:suppliers,id' ]; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $rules; |
@@ -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 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $purchase = Purchase::findOrFail($id); |
| 41 | 41 | |
| 42 | 42 | return fractal()->item($purchase, new PurchaseTransformer) |
| 43 | - ->parseIncludes(['guitars', 'supplier']) |
|
| 43 | + ->parseIncludes([ 'guitars', 'supplier' ]) |
|
| 44 | 44 | ->toArray(); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $this->info('Starting Installation...'); |
| 33 | 33 | |
| 34 | - if ( ! env('APP_KEY')) { |
|
| 34 | + if (!env('APP_KEY')) { |
|
| 35 | 35 | $this->info('Generating app key'); |
| 36 | 36 | Artisan::call('key:generate'); |
| 37 | 37 | } else { |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $this->info('Migrating database'); |
| 42 | - Artisan::call('migrate', ['--force' => true]); |
|
| 42 | + Artisan::call('migrate', [ '--force' => true ]); |
|
| 43 | 43 | |
| 44 | - if ( ! User::count()) { |
|
| 44 | + if (!User::count()) { |
|
| 45 | 45 | $this->info('Seeding initial data'); |
| 46 | - Artisan::call('db:seed', ['--force' => true]); |
|
| 46 | + Artisan::call('db:seed', [ '--force' => true ]); |
|
| 47 | 47 | } else { |
| 48 | 48 | $this->comment('Skipping - Data already seeded'); |
| 49 | 49 | } |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function broadcastOn() |
| 15 | 15 | { |
| 16 | - return ['default']; |
|
| 16 | + return [ 'default' ]; |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function broadcastWith() |
| 20 | 20 | { |
| 21 | - return []; |
|
| 21 | + return [ ]; |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -Route::group(['middleware' => 'web'], function ($router) { |
|
| 4 | - $router->get('/', function () { |
|
| 3 | +Route::group([ 'middleware' => 'web' ], function($router) { |
|
| 4 | + $router->get('/', function() { |
|
| 5 | 5 | return redirect('/dashboard'); |
| 6 | 6 | }); |
| 7 | 7 | |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | $router->put('api/notifications/{id}/dismiss', 'API\NotificationController@dismiss'); |
| 36 | 36 | $router->get('api/users/me', 'API\UserController@getCurrentUser'); |
| 37 | 37 | |
| 38 | - $router->resource('makes', 'MakeController', ['except' => ['create', 'show', 'edit', 'update']]); |
|
| 39 | - $router->resource('models', 'ModelController', ['except' => ['create', 'show', 'edit', 'update']]); |
|
| 40 | - $router->resource('purchases', 'PurchaseController', ['except' => ['create', 'edit', 'update']]); |
|
| 38 | + $router->resource('makes', 'MakeController', [ 'except' => [ 'create', 'show', 'edit', 'update' ] ]); |
|
| 39 | + $router->resource('models', 'ModelController', [ 'except' => [ 'create', 'show', 'edit', 'update' ] ]); |
|
| 40 | + $router->resource('purchases', 'PurchaseController', [ 'except' => [ 'create', 'edit', 'update' ] ]); |
|
| 41 | 41 | $router->post('purchases/{id}/guitars', 'GuitarController@store'); |
| 42 | - $router->resource('suppliers', 'SupplierController', ['except' => ['create', 'show', 'edit', 'update']]); |
|
| 43 | - $router->resource('warehouses', 'WarehouseController', ['except' => ['create', 'show', 'edit']]); |
|
| 44 | - $router->resource('guitars', 'GuitarController', ['only' => ['index', 'update', 'destroy']]); |
|
| 42 | + $router->resource('suppliers', 'SupplierController', [ 'except' => [ 'create', 'show', 'edit', 'update' ] ]); |
|
| 43 | + $router->resource('warehouses', 'WarehouseController', [ 'except' => [ 'create', 'show', 'edit' ] ]); |
|
| 44 | + $router->resource('guitars', 'GuitarController', [ 'only' => [ 'index', 'update', 'destroy' ] ]); |
|
| 45 | 45 | $router->get('guitars/{id}/sale', 'GuitarController@showSaleFor'); |
| 46 | 46 | $router->post('guitars/{id}/sale', 'GuitarController@sale'); |
| 47 | 47 | }); |
@@ -13,33 +13,33 @@ |
||
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | 15 | protected $listen = [ |
| 16 | - 'App\Events\MakeWasCreated' => [], |
|
| 17 | - 'App\Events\MakeWasDeleted' => [], |
|
| 16 | + 'App\Events\MakeWasCreated' => [ ], |
|
| 17 | + 'App\Events\MakeWasDeleted' => [ ], |
|
| 18 | 18 | |
| 19 | - 'App\Events\ModelWasCreated' => [], |
|
| 20 | - 'App\Events\ModelWasDeleted' => [], |
|
| 19 | + 'App\Events\ModelWasCreated' => [ ], |
|
| 20 | + 'App\Events\ModelWasDeleted' => [ ], |
|
| 21 | 21 | |
| 22 | - 'App\Events\WarehouseWasCreated' => [], |
|
| 23 | - 'App\Events\WarehouseWasUpdated' => [], |
|
| 24 | - 'App\Events\WarehouseWasDeleted' => [], |
|
| 22 | + 'App\Events\WarehouseWasCreated' => [ ], |
|
| 23 | + 'App\Events\WarehouseWasUpdated' => [ ], |
|
| 24 | + 'App\Events\WarehouseWasDeleted' => [ ], |
|
| 25 | 25 | |
| 26 | - 'App\Events\SupplierWasCreated' => [], |
|
| 27 | - 'App\Events\SupplierWasDeleted' => [], |
|
| 26 | + 'App\Events\SupplierWasCreated' => [ ], |
|
| 27 | + 'App\Events\SupplierWasDeleted' => [ ], |
|
| 28 | 28 | |
| 29 | 29 | 'App\Events\PurchaseWasCreated' => [ |
| 30 | 30 | 'App\Listeners\GeneratePurchaseNotification', |
| 31 | 31 | ], |
| 32 | - 'App\Events\PurchaseWasDeleted' => [], |
|
| 32 | + 'App\Events\PurchaseWasDeleted' => [ ], |
|
| 33 | 33 | |
| 34 | - 'App\Events\GuitarWasCreated' => [], |
|
| 35 | - 'App\Events\GuitarWasUpdated' => [], |
|
| 36 | - 'App\Events\GuitarWasDeleted' => [], |
|
| 34 | + 'App\Events\GuitarWasCreated' => [ ], |
|
| 35 | + 'App\Events\GuitarWasUpdated' => [ ], |
|
| 36 | + 'App\Events\GuitarWasDeleted' => [ ], |
|
| 37 | 37 | |
| 38 | - 'App\Events\SaleWasCreated' => [], |
|
| 39 | - 'App\Events\SaleWasDeleted' => [], |
|
| 38 | + 'App\Events\SaleWasCreated' => [ ], |
|
| 39 | + 'App\Events\SaleWasDeleted' => [ ], |
|
| 40 | 40 | |
| 41 | - 'App\Events\NotificationWasCreated' => [], |
|
| 42 | - 'App\Events\NotificationWasDismissed' => [], |
|
| 41 | + 'App\Events\NotificationWasCreated' => [ ], |
|
| 42 | + 'App\Events\NotificationWasDismissed' => [ ], |
|
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | 45 | /** |