Laravel 11 (#84)

* Convert string references to `::class`

PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.

* Use Faker methods

Accessing Faker properties was deprecated in Faker 1.14.

* Convert route options to fluent methods

Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.

* Adopt class based routes

* Remove default `app` files

* Shift core files

* Streamline config files

* Set new `ENV` variables

* Default new `bootstrap/app.php`

* Re-register HTTP middleware

* Consolidate service providers

* Re-register service providers

* Re-register routes

* Re-register scheduled commands

* Bump Composer dependencies

* Use `<env>` tags for configuration

`<env>` tags have a lower precedence than system environment variables making it easier to overwrite PHPUnit configuration values in additional environments, such a CI.

Review this blog post for more details on configuration precedence when testing Laravel: https://jasonmccreary.me/articles/laravel-testing-configuration-precedence/

* Adopt anonymous migrations

* Rename `password_resets` table

* Convert `$casts` property to method

* Adopt Laravel type hints

* Mark base controller as `abstract`

* Remove `CreatesApplication` testing trait

* Shift cleanup

* Fix shift first issues

* Updating Rules for laravel 11, sanctum config and pint

* Fix Carbon issue on dashboard

* Temporary fix for tests while migration is issue fixed on laravel side

* Carbon needs numerical values, not strings

* Minimum php version

* Fix domain installation step not fetching the correct company_id

* Fix Role Policy wasn't properly registered

---------
This commit is contained in:
mchev
2024-06-05 11:33:52 +02:00
committed by GitHub
parent 72311db1bd
commit 3259173066
656 changed files with 4964 additions and 7944 deletions

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Estimate;
use Carbon\Carbon;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Estimate;
class CheckEstimateStatus extends Command
{
@@ -37,7 +37,7 @@ class CheckEstimateStatus extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$date = Carbon::now();
$status = [Estimate::STATUS_ACCEPTED, Estimate::STATUS_REJECTED, Estimate::STATUS_EXPIRED];

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Invoice;
use Carbon\Carbon;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Invoice;
class CheckInvoiceStatus extends Command
{
@@ -37,7 +37,7 @@ class CheckInvoiceStatus extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$date = Carbon::now();
$invoices = Invoice::whereNotIn('status', [Invoice::STATUS_COMPLETED, Invoice::STATUS_DRAFT])

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
@@ -33,10 +33,8 @@ class CreateTemplateCommand extends Command
/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
$templateName = $this->argument('name');
$type = $this->option('type');

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Space\ModuleInstaller;
use Illuminate\Console\Command;
use InvoiceShelf\Space\ModuleInstaller;
class InstallModuleCommand extends Command
{
@@ -33,10 +33,8 @@ class InstallModuleCommand extends Command
/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
ModuleInstaller::complete($this->argument('module'), $this->argument('version'));

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
@@ -39,7 +39,7 @@ class ResetApp extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
if (! $this->confirmToProceed()) {
return;

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Setting;
use App\Space\Updater;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Setting;
use InvoiceShelf\Space\Updater;
// Implementation taken from Akaunting - https://github.com/akaunting/akaunting
class UpdateCommand extends Command
@@ -42,7 +42,7 @@ class UpdateCommand extends Command
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
set_time_limit(3600); // 1 hour