@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\User::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\User::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'name' => $faker->name, |
| 6 | 6 | 'email' => $faker->email, |
@@ -9,47 +9,47 @@ discard block |
||
| 9 | 9 | ]; |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | -$factory->define(App\Warehouse::class, function (Faker\Generator $faker) { |
|
| 12 | +$factory->define(App\Warehouse::class, function(Faker\Generator $faker) { |
|
| 13 | 13 | return [ |
| 14 | 14 | 'name' => 'Warehouse #'.$faker->numberBetween(), |
| 15 | 15 | ]; |
| 16 | 16 | }); |
| 17 | 17 | |
| 18 | -$factory->define(App\Make::class, function (Faker\Generator $faker) { |
|
| 18 | +$factory->define(App\Make::class, function(Faker\Generator $faker) { |
|
| 19 | 19 | return [ |
| 20 | 20 | 'name' => $faker->words(2, true), |
| 21 | 21 | ]; |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | -$factory->define(App\Supplier::class, function (Faker\Generator $faker) { |
|
| 24 | +$factory->define(App\Supplier::class, function(Faker\Generator $faker) { |
|
| 25 | 25 | return [ |
| 26 | 26 | 'name' => $faker->company, |
| 27 | 27 | 'location' => $faker->address, |
| 28 | 28 | ]; |
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | -$factory->define(App\Shop::class, function (Faker\Generator $faker) { |
|
| 31 | +$factory->define(App\Shop::class, function(Faker\Generator $faker) { |
|
| 32 | 32 | return [ |
| 33 | 33 | 'name' => $faker->company, |
| 34 | 34 | 'address' => $faker->address, |
| 35 | 35 | ]; |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | -$factory->define(App\Rack::class, function (Faker\Generator $faker) { |
|
| 38 | +$factory->define(App\Rack::class, function(Faker\Generator $faker) { |
|
| 39 | 39 | return [ |
| 40 | 40 | 'name' => 'Rack #'.$faker->numberBetween(1, 20), |
| 41 | 41 | 'capacity' => $faker->randomNumber(3), |
| 42 | 42 | ]; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | -$factory->define(App\Model::class, function (Faker\Generator $faker) { |
|
| 45 | +$factory->define(App\Model::class, function(Faker\Generator $faker) { |
|
| 46 | 46 | return [ |
| 47 | 47 | 'name' => 'Model #'.$faker->numberBetween(1, 20), |
| 48 | 48 | 'photo' => config('shop.images.dir').$faker->image(config('shop.images.path'), 640, 480, 'technics', null), |
| 49 | 49 | ]; |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | -$factory->define(App\Purchase::class, function (Faker\Generator $faker) { |
|
| 52 | +$factory->define(App\Purchase::class, function(Faker\Generator $faker) { |
|
| 53 | 53 | return [ |
| 54 | 54 | 'quantity' => $faker->randomNumber(2), |
| 55 | 55 | 'price' => $faker->randomFloat(2, 1000), |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ]; |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | -$factory->defineAs(App\Purchase::class, 'delivered', function (Faker\Generator $faker) use ($factory) { |
|
| 61 | +$factory->defineAs(App\Purchase::class, 'delivered', function(Faker\Generator $faker) use ($factory) { |
|
| 62 | 62 | $user = $factory->raw(App\Purchase::class); |
| 63 | 63 | |
| 64 | 64 | return array_merge($user, [ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ]); |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | -$factory->define(App\Guitar::class, function (Faker\Generator $faker) { |
|
| 70 | +$factory->define(App\Guitar::class, function(Faker\Generator $faker) { |
|
| 71 | 71 | return [ |
| 72 | 72 | 'colour' => $faker->colorName, |
| 73 | 73 | 'damaged' => $faker->boolean(), |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | ]; |
| 77 | 77 | }); |
| 78 | 78 | |
| 79 | -$factory->define(App\Sale::class, function (Faker\Generator $faker) { |
|
| 79 | +$factory->define(App\Sale::class, function(Faker\Generator $faker) { |
|
| 80 | 80 | return [ |
| 81 | 81 | 'name' => $faker->name, |
| 82 | 82 | 'address' => $faker->address, |
| 83 | 83 | ]; |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | -$factory->defineAs(App\Sale::class, 'shop', function (Faker\Generator $faker) { |
|
| 86 | +$factory->defineAs(App\Sale::class, 'shop', function(Faker\Generator $faker) { |
|
| 87 | 87 | return [ |
| 88 | 88 | 'shop_id' => factory(App\Shop::class)->create()->id, |
| 89 | 89 | ]; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function handle(PurchaseWasCreated $event) |
| 19 | 19 | { |
| 20 | 20 | $purchase = $event->purchase; |
| 21 | - if ($purchase->hasArrived() && $purchase->isPendingStorage() && ! $purchase->notifications()->count()) { |
|
| 21 | + if ($purchase->hasArrived() && $purchase->isPendingStorage() && !$purchase->notifications()->count()) { |
|
| 22 | 22 | $purchase->makeNotification(); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @var array |
| 13 | 13 | */ |
| 14 | - protected $dates = ['deleted_at']; |
|
| 14 | + protected $dates = [ 'deleted_at' ]; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * The attributes that are not mass assignable. |
| 18 | 18 | * |
| 19 | 19 | * @var array |
| 20 | 20 | */ |
| 21 | - protected $guarded = []; |
|
| 21 | + protected $guarded = [ ]; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
@@ -54,6 +54,6 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function dismiss() |
| 56 | 56 | { |
| 57 | - return $this->update(['dismissed' => true]); |
|
| 57 | + return $this->update([ 'dismissed' => true ]); |
|
| 58 | 58 | } |
| 59 | 59 | } |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | protected function schedule(Schedule $schedule) |
| 29 | 29 | { |
| 30 | 30 | $schedule->command('purchases:check') |
| 31 | - ->dailyAt('00:01'); |
|
| 31 | + ->dailyAt('00:01'); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -11,14 +11,14 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * @var array |
| 13 | 13 | */ |
| 14 | - protected $dates = ['deleted_at']; |
|
| 14 | + protected $dates = [ 'deleted_at' ]; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * The attributes that are not mass assignable. |
| 18 | 18 | * |
| 19 | 19 | * @var array |
| 20 | 20 | */ |
| 21 | - protected $guarded = []; |
|
| 21 | + protected $guarded = [ ]; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Guitar that was sold. |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $dates = ['deleted_at']; |
|
| 15 | + protected $dates = [ 'deleted_at' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * The attributes that are mass assignable. |
@@ -42,6 +42,6 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function getAvatarAttribute() |
| 44 | 44 | { |
| 45 | - return 'http://www.gravatar.com/avatar/' . md5($this->attributes['email']); |
|
| 45 | + return 'http://www.gravatar.com/avatar/'.md5($this->attributes[ 'email' ]); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | 'password' => 'required|confirmed|min:6', |
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | - if ( ! Hash::check($request->current_password, Auth::user()->password)) { |
|
| 44 | + if (!Hash::check($request->current_password, Auth::user()->password)) { |
|
| 45 | 45 | return response()->json( |
| 46 | - ['current_password' => ['The current password you provided is incorrect.']], 422 |
|
| 46 | + [ 'current_password' => [ 'The current password you provided is incorrect.' ] ], 422 |
|
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $availableIncludes = ['purchase', 'sale']; |
|
| 15 | + protected $availableIncludes = [ 'purchase', 'sale' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Turn this item object into a generic array. |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | 'id' => $guitar->isSold() ? $guitar->sale->id : null, |
| 48 | 48 | 'name' => $guitar->isSold() ? $guitar->sale->name : null, |
| 49 | 49 | 'address' => $guitar->isSold() ? $guitar->sale->address : null, |
| 50 | - 'date' => $guitar->isSold() ? (string)$guitar->sale->created_at->toFormattedDateString() : null, |
|
| 50 | + 'date' => $guitar->isSold() ? (string) $guitar->sale->created_at->toFormattedDateString() : null, |
|
| 51 | 51 | ], |
| 52 | 52 | 'make_id' => $guitar->make_id, |
| 53 | 53 | 'model_id' => $guitar->model_id, |
| 54 | 54 | 'rack_id' => $guitar->rack_id, |
| 55 | 55 | 'colour' => $guitar->colour, |
| 56 | - 'price' => (float)$guitar->price, |
|
| 57 | - 'damaged' => (bool)$guitar->damaged, |
|
| 56 | + 'price' => (float) $guitar->price, |
|
| 57 | + 'damaged' => (bool) $guitar->damaged, |
|
| 58 | 58 | 'condition' => $guitar->condition, |
| 59 | - 'sold' => (bool)$guitar->isSold(), |
|
| 59 | + 'sold' => (bool) $guitar->isSold(), |
|
| 60 | 60 | ]; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -17,15 +17,15 @@ |
||
| 17 | 17 | public function transform(Notification $notification) |
| 18 | 18 | { |
| 19 | 19 | return [ |
| 20 | - 'id' => (int)$notification->id, |
|
| 21 | - 'icon' => (string)$notification->icon, |
|
| 22 | - 'link' => (string)$notification->link, |
|
| 23 | - 'message' => (string)$notification->message, |
|
| 24 | - 'dismissed' => (bool)$notification->dismissed, |
|
| 20 | + 'id' => (int) $notification->id, |
|
| 21 | + 'icon' => (string) $notification->icon, |
|
| 22 | + 'link' => (string) $notification->link, |
|
| 23 | + 'message' => (string) $notification->message, |
|
| 24 | + 'dismissed' => (bool) $notification->dismissed, |
|
| 25 | 25 | 'created' => [ |
| 26 | 26 | 'timestamp' => $notification->created_at->getTimestamp(), |
| 27 | - 'date' => (string)$notification->created_at->toFormattedDateString(), |
|
| 28 | - 'readable' => (string)$notification->created_at->diffForHumans(), |
|
| 27 | + 'date' => (string) $notification->created_at->toFormattedDateString(), |
|
| 28 | + 'readable' => (string) $notification->created_at->diffForHumans(), |
|
| 29 | 29 | ], |
| 30 | 30 | ]; |
| 31 | 31 | } |