Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Shift) Laravel 12.x.x #4500

Open
wants to merge 32 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
18eab8f
Convert string references to `::class`
laravel-shift Feb 25, 2025
14e13e8
Use Faker methods
laravel-shift Feb 25, 2025
51394a0
Remove unnecessary `$model` property
laravel-shift Feb 25, 2025
8d845cf
Convert route options to fluent methods
laravel-shift Feb 25, 2025
cad18ef
Slim `lang` files
laravel-shift Feb 25, 2025
8392f79
Shift core files
laravel-shift Feb 25, 2025
40845c0
Adopt new PHP attributes in models
laravel-shift Feb 25, 2025
bdfa733
Remove unused `ValidatesRequests` trait
laravel-shift Feb 25, 2025
731e811
Remove unused `AuthorizesRequests` trait
laravel-shift Feb 25, 2025
21da0f0
Remove base controller inheritance
laravel-shift Feb 25, 2025
fec634e
Shift config files
laravel-shift Feb 25, 2025
a802ca2
Default config files
laravel-shift Feb 25, 2025
7d5ee66
Set new `ENV` variables
laravel-shift Feb 25, 2025
5f15605
Add new Laravel `composer run dev` script
laravel-shift Feb 25, 2025
9414858
Add `storage/app/private` folder
laravel-shift Feb 25, 2025
a1225a8
Bump Composer dependencies
laravel-shift Feb 25, 2025
2526fa4
Rename `password_resets` table
laravel-shift Feb 25, 2025
27f9fe4
Adopt Laravel type hints
laravel-shift Feb 25, 2025
1604d61
Shift cleanup
laravel-shift Feb 25, 2025
60268e4
Blade Style Change (Prettier Blade CI)
HDVinnie Feb 25, 2025
cd8a331
revert: "Convert string references to `::class`"
HDVinnie Feb 27, 2025
b57f019
revert: "Slim `lang` files"
HDVinnie Feb 27, 2025
de428a0
remove: old observer comment
HDVinnie Feb 27, 2025
8d35382
revert: config changes
HDVinnie Feb 27, 2025
29cb520
update: composer.json
HDVinnie Feb 27, 2025
1133a87
update: composer dependencies
HDVinnie Feb 27, 2025
f4cd00f
update: composer dependencies
HDVinnie Feb 28, 2025
8d6ecf1
update: remove old excludes from phpstan.neon
HDVinnie Feb 28, 2025
3edbc78
remove: old markdown test
HDVinnie Feb 28, 2025
b634be9
update: .cspell/laravel.txt
HDVinnie Feb 28, 2025
2e170ad
update: markdown helper
HDVinnie Feb 28, 2025
c966bd6
update: laravel 12 support
HDVinnie Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_SCHEME=null
MAIL_FROM_ADDRESS='support@unit3d.site'
MAIL_FROM_NAME='UNIT3D Support'

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/public/storage
/public/vendor
/storage/backups
/storage/pail
/storage/debugbar
/storage/gitupdate
/storage/*.key
Expand All @@ -29,6 +30,7 @@ laravel-echo-server.lock

# IDEs
/.idea
/.nova
/.vscode
/nbproject
/.phpunit.cache
Expand Down
8 changes: 1 addition & 7 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

abstract class Controller extends BaseController
abstract class Controller
{
use AuthorizesRequests;
use ValidatesRequests;
}
2 changes: 1 addition & 1 deletion app/Http/Requests/Staff/StoreDonationGatewayRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StoreDonationGatewayRequest extends FormRequest
*
* @return bool
*/
public function authorize()
public function authorize(): bool
{
return $this->user()->group->is_owner;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Staff/UpdateDonationGatewayRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UpdateDonationGatewayRequest extends FormRequest
*
* @return bool
*/
public function authorize()
public function authorize(): bool
{
return $this->user()->group->is_owner;
}
Expand Down
7 changes: 2 additions & 5 deletions app/Models/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\ScopedBy;
use App\Models\Scopes\ApprovedScope;
use App\Traits\Auditable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
Expand All @@ -35,6 +36,7 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
*/
#[ScopedBy([ApprovedScope::class])]
class Application extends Model
{
use Auditable;
Expand Down Expand Up @@ -65,11 +67,6 @@ protected function casts(): array
*/
protected $guarded = ['id', 'created_at', 'updated_at'];

protected static function booted(): void
{
static::addGlobalScope(new ApprovedScope());
}

/**
* Belongs To A User.
*
Expand Down
7 changes: 2 additions & 5 deletions app/Models/Subtitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\ScopedBy;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Helpers\StringHelper;
use App\Models\Scopes\ApprovedScope;
Expand Down Expand Up @@ -43,6 +44,7 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
*/
#[ScopedBy([ApprovedScope::class])]
class Subtitle extends Model
{
use Auditable;
Expand All @@ -67,11 +69,6 @@ protected function casts(): array
];
}

protected static function booted(): void
{
static::addGlobalScope(new ApprovedScope());
}

/**
* Belongs To A User.
*
Expand Down
7 changes: 2 additions & 5 deletions app/Models/Torrent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\ScopedBy;
use App\Helpers\StringHelper;
use App\Models\Scopes\ApprovedScope;
use App\Notifications\NewComment;
Expand Down Expand Up @@ -80,6 +81,7 @@
* @property int|null $balance
* @property int|null $balance_offset
*/
#[ScopedBy([ApprovedScope::class])]
class Torrent extends Model
{
use Auditable;
Expand Down Expand Up @@ -475,11 +477,6 @@ protected function casts(): array
) AS json_keywords
SQL;

protected static function booted(): void
{
static::addGlobalScope(new ApprovedScope());
}

/**
* Belongs To A User.
*
Expand Down
3 changes: 3 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace App\Models;

use App\Observers\UserObserver;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use App\Helpers\StringHelper;
use App\Traits\UsersOnlineTrait;
use Assada\Achievements\Achiever;
Expand Down Expand Up @@ -74,6 +76,7 @@
* @property int $own_flushes
* @property string|null $email_verified_at
*/
#[ObservedBy([UserObserver::class])]
class User extends Authenticatable implements MustVerifyEmail
{
use Achiever;
Expand Down
2 changes: 0 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use App\Helpers\HiddenCaptcha;
use App\Interfaces\ByteUnitsInterface;
use App\Models\User;
use App\Observers\UserObserver;
use App\View\Composers\FooterComposer;
use App\View\Composers\TopNavComposer;
use Illuminate\Support\Facades\Blade;
Expand Down Expand Up @@ -52,7 +51,6 @@ public function register(): void
public function boot(): void
{
// User Observer For Cache
User::observe(UserObserver::class);

// Hidden Captcha
Blade::directive('hiddencaptcha', fn ($mustBeEmptyField = '_username') => \sprintf('<?= App\Helpers\HiddenCaptcha::render(%s); ?>', $mustBeEmptyField));
Expand Down
Binary file modified bun.lockb
Binary file not shown.
34 changes: 19 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,49 @@
"doctrine/dbal": "^3.9.4",
"gabrielelana/byte-units": "^0.5.0",
"graham-campbell/markdown": "^15.2",
"guzzlehttp/guzzle": "^7.9.2",
"hdvinnie/laravel-joypixel-emojis": "^v3.0.0",
"hdvinnie/laravel-security-headers": "^v3.0.0",
"intervention/image": "^2.7.2",
"joypixels/assets": "^v7.0.1",
"laravel/fortify": "1.20.0",
"laravel/framework": "^11.44.0",
"laravel/octane": "^2.6.0",
"laravel/fortify": "^1.25",
"laravel/framework": "^12.0",
"laravel/octane": "^2.8",
"laravel/scout": "^10.12.0",
"laravel/tinker": "^2.10.0",
"laravel/tinker": "^2.10.1",
"livewire/livewire": "^3.5.18",
"marcreichel/igdb-laravel": "^4.3.0",
"meilisearch/meilisearch-php": "^1.12.0",
"nesbot/carbon": "^2.73.0",
"nesbot/carbon": "^3.8",
"paragonie/constant_time_encoding": "^2.7.0",
"resend/resend-laravel": "^0.14.0",
"spatie/laravel-backup": "^8.8.2",
"resend/resend-laravel": "dev-chore-laravel-12",
"spatie/laravel-backup": "^9.2",
"spatie/laravel-cookie-consent": "^3.3.2",
"spatie/laravel-image-optimizer": "^1.8.0",
"spatie/ssl-certificate": "^2.6.8",
"symfony/dom-crawler": "^6.4.16",
"symfony/dom-crawler": "^7.2",
"theodorejb/polycast": "dev-master",
"vstelmakh/url-highlight": "^3.1.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.14.10",
"barryvdh/laravel-debugbar": "^3.15",
"brianium/paratest": "^7.7",
"calebdw/larastan": "^3.1.7",
"calebdw/larastan-livewire": "^2.1.0",
"fakerphp/faker": "^1.24.1",
"jasonmccreary/laravel-test-assertions": "^2.4.1",
"jasonmccreary/laravel-test-assertions": "^2.5",
"laravel/pint": "v1.20.0",
"laravel/sail": "^1.40.0",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^8.5.0",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^3.7.2",
"pestphp/pest-plugin-laravel": "^3.0",
"pestphp/pest-plugin-laravel": "^3.1",
"pestphp/pest-plugin-livewire": "^3.0",
"phpstan/phpstan": "^2.1.6",
"phpunit/phpunit": "^11.5.3",
"ryoluo/sail-ssl": "^1.3.2",
"spatie/laravel-ignition": "^2.9.0",
"tomasvotruba/bladestan": "^0.11.0"
"tomasvotruba/bladestan": "^0.11.0",
"laravel/pail": "^1.2.2"
},
"config": {
"preferred-install": "dist",
Expand Down Expand Up @@ -112,6 +112,10 @@
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
]
}
}
2 changes: 1 addition & 1 deletion config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
Expand Down
23 changes: 19 additions & 4 deletions config/broadcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
| Supported: "reverb", "pusher", "ably", "redis", "log", "null"
|
*/

Expand All @@ -24,20 +24,35 @@
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| to broadcast events to other systems or over WebSockets. Samples of
| each available type of connection are provided inside this array.
|
*/

'connections' => [
'reverb' => [
'driver' => 'reverb',
'key' => env('REVERB_APP_KEY'),
'secret' => env('REVERB_APP_SECRET'),
'app_id' => env('REVERB_APP_ID'),
'options' => [
'host' => env('REVERB_HOST'),
'port' => env('REVERB_PORT', 443),
'scheme' => env('REVERB_SCHEME', 'https'),
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],

'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),

'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
Expand Down
32 changes: 17 additions & 15 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
| This option controls the default cache store that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a cache operation inside the application.
|
*/

'default' => env('CACHE_STORE', 'file'),
'default' => env('CACHE_STORE', 'database'),

/*
|--------------------------------------------------------------------------
Expand All @@ -27,8 +27,8 @@
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane", "null"
|
*/

Expand All @@ -44,14 +44,16 @@

'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],

'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],

'memcached' => [
Expand All @@ -75,8 +77,8 @@

'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],

'dynamodb' => [
Expand All @@ -98,8 +100,8 @@
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| stores there might be other applications using the same cache. For
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
Expand Down
Loading