Skip to content

Commit

Permalink
Laravel 11 (#53)
Browse files Browse the repository at this point in the history
* Upgrade to Laravel 11

* Upgrade dependencies and migrate model casts

* Update dependencies
  • Loading branch information
GeniJaho authored Mar 15, 2024
1 parent 5b943f4 commit 6044b1a
Show file tree
Hide file tree
Showing 20 changed files with 1,216 additions and 1,261 deletions.
4 changes: 2 additions & 2 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
namespace App\Http;

use App\Http\Middleware\Authenticate;
use App\Http\Middleware\EncryptCookies;
use App\Http\Middleware\HandleInertiaRequests;
use App\Http\Middleware\PreventRequestsDuringMaintenance;
use App\Http\Middleware\RedirectIfAuthenticated;
use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\TrustProxies;
use App\Http\Middleware\ValidateSignature;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
use Illuminate\Auth\Middleware\RequirePassword;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Http\Middleware\SetCacheHeaders;
Expand Down
17 changes: 0 additions & 17 deletions app/Http/Middleware/EncryptCookies.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Http/Middleware/VerifyCsrfToken.php

This file was deleted.

14 changes: 10 additions & 4 deletions app/Models/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class Photo extends Model
{
use HasFactory;

protected $casts = [
'user_id' => 'integer',
];

/**
* @return BelongsTo<User, Photo>
*/
Expand Down Expand Up @@ -99,4 +95,14 @@ public function scopeFilter(Builder $query, ?PhotoFilters $filters): void
->when($filters->is_tagged === true, fn ($query) => $query->whereHas('items'))
->when($filters->is_tagged === false, fn ($query) => $query->whereDoesntHave('items'));
}

/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'user_id' => 'integer',
];
}
}
18 changes: 12 additions & 6 deletions app/Models/PhotoItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ class PhotoItem extends Pivot

public $incrementing = true;

protected $casts = [
'picked_up' => 'boolean',
'recycled' => 'boolean',
'deposit' => 'boolean',
];

/**
* @return BelongsTo<Item, PhotoItem>
*/
Expand Down Expand Up @@ -59,4 +53,16 @@ public function tags(): BelongsToMany
->using(PhotoItemTag::class)
->withTimestamps();
}

/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'picked_up' => 'boolean',
'recycled' => 'boolean',
'deposit' => 'boolean',
];
}
}
19 changes: 10 additions & 9 deletions app/Models/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ class Team extends JetstreamTeam
{
use HasFactory;

/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'personal_team' => 'boolean',
];

/**
* The event map for the model.
*
Expand All @@ -34,4 +25,14 @@ class Team extends JetstreamTeam
'updated' => TeamUpdated::class,
'deleted' => TeamDeleted::class,
];

/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'personal_team' => 'boolean',
];
}
}
21 changes: 11 additions & 10 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ class User extends Authenticatable implements FilamentUser, MustVerifyEmail
'two_factor_secret',
];

/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'settings' => UserSettings::class.':default',
];

/**
* The accessors to append to the model's array form.
*
Expand Down Expand Up @@ -129,4 +119,15 @@ public function photos(): HasMany
{
return $this->hasMany(Photo::class);
}

/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'settings' => UserSettings::class.':default',
];
}
}
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@
],
"license": "MIT",
"require": {
"php": "^8.1",
"php": "^8.2",
"filament/filament": "^3.1",
"filipfonal/filament-log-manager": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.6.8",
"inertiajs/inertia-laravel": "^v1.0",
"intervention/image": "^3.2",
"laravel/framework": "^10.10",
"laravel/jetstream": "^3.2",
"laravel/framework": "^11.0",
"laravel/jetstream": "^5.0",
"laravel/pail": "^1.1",
"laravel/sanctum": "^3.2",
"laravel/sanctum": "^4.0",
"laravel/socialite": "^5.11",
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.0",
"spatie/laravel-data": "^4.0",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
"driftingly/rector-laravel": "1.0.0",
"driftingly/rector-laravel": "^1.0.0",
"fakerphp/faker": "^1.9.1",
"knuckleswtf/scribe": "^4.30",
"larastan/larastan": "^2.0",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/collision": "^8.1",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-watch": "^2.0",
"rector/rector": "^1.0.0",
"rector/rector": "^1.0.2",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
Expand Down
Loading

0 comments on commit 6044b1a

Please sign in to comment.