@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fg_guests', function (Blueprint $table) { |
|
16 | + Schema::create('fg_guests', function(Blueprint $table) { |
|
17 | 17 | $table->string('id')->index()->primary(); |
18 | 18 | $table->string('event_id', 150)->index(); |
19 | 19 | $table->string('title'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fg_events', function (Blueprint $table) { |
|
16 | + Schema::create('fg_events', function(Blueprint $table) { |
|
17 | 17 | $table->string('id')->index()->primary(); |
18 | 18 | $table->string('ministry_id', 150)->index(); |
19 | 19 | $table->string('name'); |
@@ -38,11 +38,11 @@ |
||
38 | 38 | public function create(CreateRequest $request) |
39 | 39 | { |
40 | 40 | $params = $request->validated(); |
41 | - if (! $request->has('location')) { |
|
42 | - if (! auth()->user()->profile->location) { |
|
41 | + if (!$request->has('location')) { |
|
42 | + if (!auth()->user()->profile->location) { |
|
43 | 43 | throw new NotFoundException('No location found for this event, set one or set your profile location!', 404); |
44 | 44 | } else { |
45 | - $params['location'] = auth()->user()->profile->location; |
|
45 | + $params[ 'location' ] = auth()->user()->profile->location; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | if ($ministry->account->level === 'Free') { |
34 | 34 | return false; |
35 | 35 | } |
36 | - if ($ministry->events()->where(request()->only(['name', 'start', 'end']))->count()) { |
|
36 | + if ($ministry->events()->where(request()->only([ 'name', 'start', 'end' ]))->count()) { |
|
37 | 37 | abort(403, 'You already registered this event'); |
38 | 38 | } else { |
39 | 39 | return true; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function scopePublished($query) |
43 | 43 | { |
44 | - if (! config('faithgen-sdk.source')) { |
|
44 | + if (!config('faithgen-sdk.source')) { |
|
45 | 45 | return $query->wherePublished(true); |
46 | 46 | } else { |
47 | 47 | return $query; |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | |
66 | 66 | public function getImageDimensions() |
67 | 67 | { |
68 | - return [0, 50]; |
|
68 | + return [ 0, 50 ]; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getAvatarAttribute() |
72 | 72 | { |
73 | - if (! $this->image()->exists()) { |
|
73 | + if (!$this->image()->exists()) { |
|
74 | 74 | return; |
75 | 75 | } else { |
76 | 76 | return [ |
77 | - '_50' => SDK::getAsset('storage/events/50-50/'.$this->image->name), |
|
78 | - 'original' => SDK::getAsset('storage/events/original/'.$this->image->name), |
|
77 | + '_50' => SDK::getAsset('storage/events/50-50/' . $this->image->name), |
|
78 | + 'original' => SDK::getAsset('storage/events/original/' . $this->image->name), |
|
79 | 79 | ]; |
80 | 80 | } |
81 | 81 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | use ImageableTrait, StorageTrait; |
13 | 13 | |
14 | 14 | protected $table = 'fg_guests'; |
15 | - protected $guarded = ['id']; |
|
15 | + protected $guarded = [ 'id' ]; |
|
16 | 16 | |
17 | 17 | protected $hidden = [ |
18 | 18 | 'created_at', |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function boot() |
24 | 24 | { |
25 | - $this->registerRoutes(__DIR__.'/../routes/events.php', __DIR__.'/../routes/source.php'); |
|
25 | + $this->registerRoutes(__DIR__ . '/../routes/events.php', __DIR__ . '/../routes/source.php'); |
|
26 | 26 | |
27 | - $this->setUpSourceFiles(function () { |
|
28 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
27 | + $this->setUpSourceFiles(function() { |
|
28 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
29 | 29 | |
30 | 30 | $this->publishes([ |
31 | - __DIR__.'/../database/migrations/' => database_path('migrations'), |
|
31 | + __DIR__ . '/../database/migrations/' => database_path('migrations'), |
|
32 | 32 | ], 'faithgen-events-migrations'); |
33 | 33 | |
34 | 34 | $this->publishes([ |
35 | - __DIR__.'/../storage/events/' => storage_path('app/public/events'), |
|
35 | + __DIR__ . '/../storage/events/' => storage_path('app/public/events'), |
|
36 | 36 | ], 'faithgen-events-storage'); |
37 | 37 | }); |
38 | 38 | |
39 | 39 | $this->publishes([ |
40 | - __DIR__.'/../config/faithgen-events.php' => config_path('faithgen-events.php'), |
|
40 | + __DIR__ . '/../config/faithgen-events.php' => config_path('faithgen-events.php'), |
|
41 | 41 | ], 'faithgen-events-config'); |
42 | 42 | |
43 | 43 | Event::observe(EventObserver::class); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function register() |
66 | 66 | { |
67 | - $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events'); |
|
67 | + $this->mergeConfigFrom(__DIR__ . '/../config/faithgen-events.php', 'faithgen-events'); |
|
68 | 68 | |
69 | 69 | $this->app->singleton(EventsService::class); |
70 | 70 | $this->app->singleton(GuestService::class); |
@@ -37,8 +37,8 @@ |
||
37 | 37 | */ |
38 | 38 | public function handle(ImageManager $imageManager) |
39 | 39 | { |
40 | - $fileName = str_shuffle($this->event->id.time().time()).'.png'; |
|
41 | - $ogSave = storage_path('app/public/events/original/').$fileName; |
|
40 | + $fileName = str_shuffle($this->event->id . time() . time()) . '.png'; |
|
41 | + $ogSave = storage_path('app/public/events/original/') . $fileName; |
|
42 | 42 | $imageManager->make($this->image)->save($ogSave); |
43 | 43 | $this->event->image()->updateOrcreate([ |
44 | 44 | 'imageable_id' => $this->event->id, |
@@ -35,10 +35,10 @@ |
||
35 | 35 | public function handle(ImageManager $imageManager) |
36 | 36 | { |
37 | 37 | if ($this->event->image()->exists()) { |
38 | - $ogImage = storage_path('app/public/events/original/').$this->event->image->name; |
|
39 | - $thumb100 = storage_path('app/public/events/50-50/').$this->event->image->name; |
|
38 | + $ogImage = storage_path('app/public/events/original/') . $this->event->image->name; |
|
39 | + $thumb100 = storage_path('app/public/events/50-50/') . $this->event->image->name; |
|
40 | 40 | |
41 | - $imageManager->make($ogImage)->fit(50, 50, function ($constraint) { |
|
41 | + $imageManager->make($ogImage)->fit(50, 50, function($constraint) { |
|
42 | 42 | $constraint->upsize(); |
43 | 43 | $constraint->aspectRatio(); |
44 | 44 | }, 'center')->save($thumb100); |