Upgrade to Laravel 11.0.3

This commit is contained in:
Kevin MacMartin 2024-03-19 17:11:58 -04:00
parent d4b58b3865
commit c4396dc63f
71 changed files with 1501 additions and 2257 deletions

View file

@ -5,9 +5,20 @@ APP_DESC='A website template'
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=America/New_York
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=stack
LOG_LEVEL=debug
@ -18,15 +29,22 @@ DB_DATABASE=hypothetical
DB_USERNAME=root
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=true
SESSION_PATH=/
SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
CACHE_PREFIX=hypothetical
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
@ -47,14 +65,6 @@ AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
MAILCHIMP_APIKEY=null
MAILCHIMP_LISTID=null

View file

@ -1 +1 @@
1a4d1dc81f7924259885250d011ffad24728cd86
087543a48c35787fa67e4b69b79ae301824adeec

View file

@ -1,27 +0,0 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View file

@ -1,30 +0,0 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}

View file

@ -17,7 +17,7 @@ class ApiController extends Controller {
public function postContactSubmit(Request $request)
{
$this->validate($request, [
$request->validate([
'name' => 'required',
'email' => 'required|email',
'message' => 'required'
@ -42,7 +42,7 @@ class ApiController extends Controller {
public function postSubscriptionSubmit(Request $request)
{
$this->validate($request, [
$request->validate([
'name' => 'required',
'email' => 'required|email'
]);

View file

@ -5,8 +5,10 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;
class ConfirmPasswordController extends Controller
class ConfirmPasswordController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@ -29,12 +31,10 @@ class ConfirmPasswordController extends Controller
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
* Get the middleware that should be assigned to the controller.
*/
public function __construct()
public static function middleware(): array
{
$this->middleware('auth');
return [ 'auth' ];
}
}

View file

@ -5,8 +5,10 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;
class LoginController extends Controller
class LoginController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@ -29,12 +31,12 @@ class LoginController extends Controller
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
* Get the middleware that should be assigned to the controller.
*/
public function __construct()
public static function middleware(): array
{
$this->middleware('guest')->except('logout');
return [
new Middleware('guest', except: [ 'logout' ]),
];
}
}

View file

@ -9,8 +9,10 @@ use App\Dashboard;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;
class RegisterController extends Controller
class RegisterController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@ -33,13 +35,11 @@ class RegisterController extends Controller
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
* Get the middleware that should be assigned to the controller.
*/
public function __construct()
public static function middleware(): array
{
$this->middleware('guest');
return [ 'guest' ];
}
/**

View file

@ -5,8 +5,10 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;
class VerificationController extends Controller
class VerificationController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@ -29,14 +31,14 @@ class VerificationController extends Controller
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
* Get the middleware that should be assigned to the controller.
*/
public function __construct()
public static function middleware(): array
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
return [
'auth',
new Middleware('signed', only: [ 'verify' ]),
new Middleware('throttle:6,1', only: [ 'verify', 'resend' ]),
];
}
}

View file

@ -2,11 +2,7 @@
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
abstract class Controller
{
use AuthorizesRequests, ValidatesRequests;
//
}

View file

@ -1,23 +1,24 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use Illuminate\Http\Request;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Auth;
use File;
use Image;
use Illuminate\Http\Request;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use App\Models\User;
use App\Dashboard;
class DashboardController extends Controller {
class DashboardController extends Controller implements HasMiddleware
{
/**
* Create a new controller instance
* Get the middleware that should be assigned to the controller.
*/
public function __construct()
public static function middleware(): array
{
$this->middleware('auth');
return [ 'auth' ];
}
/**
@ -148,7 +149,7 @@ class DashboardController extends Controller {
// Reorder Model Rows
public function postReorder(Request $request)
{
$this->validate($request, [
$request->validate([
'order' => 'required',
'column' => 'required',
'model' => 'required'
@ -176,7 +177,7 @@ class DashboardController extends Controller {
// Create and Update Model Item Data
public function postUpdate(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required',
'columns' => 'required'
@ -321,7 +322,7 @@ class DashboardController extends Controller {
// Upload Model Item Image
public function postImageUpload(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required',
'name' => 'required'
@ -353,7 +354,7 @@ class DashboardController extends Controller {
// Upload Model Item File
public function postFileUpload(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required',
'name' => 'required'
@ -385,7 +386,7 @@ class DashboardController extends Controller {
// Delete Model Item
public function deleteDelete(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required'
]);
@ -435,7 +436,7 @@ class DashboardController extends Controller {
// Delete Model Item Image
public function deleteImageDelete(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required',
'name' => 'required'
@ -459,7 +460,7 @@ class DashboardController extends Controller {
// Delete Model Item File
public function deleteFileDelete(Request $request)
{
$this->validate($request, [
$request->validate([
'id' => 'required',
'model' => 'required',
'name' => 'required'
@ -493,7 +494,7 @@ class DashboardController extends Controller {
// User Password Update
public function postUserPasswordUpdate(Request $request)
{
$this->validate($request, [
$request->validate([
'oldpass' => 'required|string|min:6',
'newpass' => 'required|string|min:6|confirmed'
]);
@ -508,7 +509,7 @@ class DashboardController extends Controller {
// User Profile Update
public function postUserProfileUpdate(Request $request)
{
$this->validate($request, [
$request->validate([
'name' => 'required|string|max:255'
]);
@ -530,7 +531,7 @@ class DashboardController extends Controller {
$user = User::find(Auth::id());
if ($user !== null) {
$image = Image::make($request->file('file'));
$image = Image::read($request->file('file'));
$max_width = User::$profile_image_max['width'];
$max_height = User::$profile_image_max['height'];
@ -543,7 +544,7 @@ class DashboardController extends Controller {
$new_width = ($new_height / $image->height()) * $image->width();
}
$image->resize($new_width, $new_height);
$image->scaleDown($new_width, $new_height);
}
File::makeDirectory(base_path() . '/public' . User::$profile_image_dir, 0755, true, true);
@ -585,5 +586,4 @@ class DashboardController extends Controller {
{
return view('dashboard.pages.credits');
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's middleware aliases.
*
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}

View file

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('login');
}
}

View file

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View file

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View file

@ -1,30 +0,0 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}

View file

@ -1,19 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}

View file

@ -1,20 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View file

@ -1,28 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View file

@ -1,22 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View file

@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View file

@ -2,10 +2,10 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
use File;
use Image;
use Illuminate\Database\Eloquent\Model;
use App\Traits\Timestamp;
class DashboardModel extends Model
@ -277,16 +277,14 @@ class DashboardModel extends Model
$max_height = $column['max_height'];
}
// Load and resize the image
$image = Image::make($file);
// Load and scale the image
$image = Image::read($file);
if ($max_width > 0 || $max_height > 0) {
$new_image_size = self::maxImageSize($max_width, $max_height, $image->width(), $image->height());
if (!is_null($new_image_size[0]) || !is_null($new_image_size[1])) {
$image->resize($new_image_size[0], $new_image_size[0], function($constraint) {
$constraint->aspectRatio();
});
$image->scaleDown($new_image_size[0], $new_image_size[0]);
}
}
@ -304,14 +302,12 @@ class DashboardModel extends Model
// Set the base file path (including the file name but not the extension)
$base_thumb_filename = $thumb_directory . $this->id . '-' . $name . '.';
// Load and resize the thumbnail
$thumb = Image::make($file);
// Load and scale the thumbnail
$thumb = Image::read($file);
$new_thumb_size = self::maxImageSize(800, 600, $thumb->width(), $thumb->height());
if (!is_null($new_thumb_size[0]) || !is_null($new_thumb_size[1])) {
$thumb->resize($new_thumb_size[0], $new_thumb_size[0], function($constraint) {
$constraint->aspectRatio();
});
$thumb->scaleDown($new_thumb_size[0], $new_thumb_size[0]);
}
// Save the thumbnail

View file

@ -39,14 +39,17 @@ class User extends Authenticatable
];
/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
/**
* The default user profile image

View file

@ -1,26 +0,0 @@
<?php
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
//
}
}

View file

@ -1,19 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View file

@ -1,38 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}

50
artisan
View file

@ -1,53 +1,15 @@
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Input\ArgvInput;
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/
// Register the Composer autoloader...
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
// Bootstrap Laravel and handle the command...
$status = (require_once __DIR__.'/bootstrap/app.php')
->handleCommand(new ArgvInput);
exit($status);

View file

@ -1,55 +1,19 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();

7
bootstrap/providers.php Normal file
View file

@ -0,0 +1,7 @@
<?php
return [
App\Providers\AppServiceProvider::class,
Spatie\Newsletter\NewsletterServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
];

View file

@ -5,27 +5,26 @@
"keywords": ["hypothetical", "template"],
"license": "MIT",
"require": {
"php": "^8.1",
"doctrine/dbal": "^3.6.1",
"php": "^8.2",
"erusev/parsedown": "^1.7.4",
"guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.7.2",
"laravel/framework": "^10.10",
"laravel/helpers": "^1.6",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2.1",
"phpoffice/phpspreadsheet": "^1.28.0",
"guzzlehttp/guzzle": "^7.8",
"intervention/image-laravel": "^1.2",
"laravel/framework": "^11.0",
"laravel/helpers": "^1.7",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
"laravel/ui": "^4.5.0",
"phpoffice/phpspreadsheet": "^2.0.0",
"spatie/laravel-newsletter": "^5.1.1"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"phpunit/phpunit": "^10.5",
"spatie/laravel-ignition": "^2.4"
},
"autoload": {
"psr-4": {
@ -51,7 +50,9 @@
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
]
},
"extra": {

1944
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,6 @@
<?php
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
return [
@ -10,9 +9,9 @@ return [
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
| other UI elements where an application name needs to be displayed.
|
*/
@ -51,26 +50,24 @@ return [
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
| the application so that it's available within Artisan commands.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/
'timezone' => 'Canada/Eastern',
'timezone' => env('APP_TIMEZONE', 'UTC'),
/*
|--------------------------------------------------------------------------
@ -78,53 +75,37 @@ return [
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
| by Laravel's translation / localization methods. This option can be
| set to any locale for which you plan to have translation strings.
|
*/
'locale' => 'en',
'locale' => env('APP_LOCALE', 'en'),
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string to ensure that all encrypted values
| are secure. You should do this prior to deploying the application.
|
*/
'cipher' => 'AES-256-CBC',
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
),
],
/*
|--------------------------------------------------------------------------
@ -140,42 +121,10 @@ return [
*/
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
/*
* Custom Service Providers...
*/
Spatie\Newsletter\NewsletterServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
])->toArray(),
/*
|--------------------------------------------------------------------------
| Class Aliases
@ -188,7 +137,6 @@ return [
*/
'aliases' => Facade::defaultAliases()->merge([
'Image' => Intervention\Image\Facades\Image::class,
'Language' => App\Utilities\Language::class,
'Version' => App\Utilities\Version::class,
])->toArray(),

View file

@ -7,15 +7,15 @@ return [
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
@ -25,11 +25,11 @@ return [
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
@ -53,12 +53,12 @@ return [
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
@ -68,7 +68,7 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
@ -82,9 +82,9 @@ return [
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
@ -99,7 +99,7 @@ return [
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_reset_tokens',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
@ -111,11 +111,11 @@ return [
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];