Upgrade to laravel 9.1.8

This commit is contained in:
Kevin MacMartin 2022-05-23 21:01:33 -04:00
parent 421ea2e844
commit 31f9ceaffa
63 changed files with 1351 additions and 1566 deletions

View file

@ -8,6 +8,7 @@ APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
@ -19,7 +20,7 @@ DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

11
.gitattributes vendored
View file

@ -1,5 +1,10 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore

View file

@ -1 +1 @@
82b5135652f3172c6d4febf1a4da967a49345a79
7216fa7e9a797227f303630d937a0722878b753b

View file

@ -7,15 +7,6 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*

View file

@ -7,19 +7,28 @@ use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];
/**
* A list of the exception types that are not reported.
*
* @var array
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
* A list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',

View file

@ -11,12 +11,12 @@ class Kernel extends HttpKernel
*
* These middleware are run during every request to your application.
*
* @var array
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
@ -26,20 +26,20 @@ class Kernel extends HttpKernel
/**
* The application's route middleware groups.
*
* @var array
* @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\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
@ -50,11 +50,12 @@ class Kernel extends HttpKernel
*
* These middleware may be assigned to groups or used individually.
*
* @var array
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
'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,

View file

@ -9,7 +9,7 @@ class EncryptCookies extends Middleware
/**
* The names of the cookies that should not be encrypted.
*
* @var array
* @var array<int, string>
*/
protected $except = [
//

View file

@ -9,7 +9,7 @@ class PreventRequestsDuringMaintenance extends Middleware
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
* @var array<int, string>
*/
protected $except = [
//

View file

@ -13,9 +13,9 @@ class RedirectIfAuthenticated
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return mixed
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next, ...$guards)
{

View file

@ -9,7 +9,7 @@ class TrimStrings extends Middleware
/**
* The names of the attributes that should not be trimmed.
*
* @var array
* @var array<int, string>
*/
protected $except = [
'current_password',

View file

@ -9,7 +9,7 @@ class TrustHosts extends Middleware
/**
* Get the host patterns that should be trusted.
*
* @return array
* @return array<int, string|null>
*/
public function hosts()
{

View file

@ -2,7 +2,7 @@
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@ -10,7 +10,7 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
* @var array|string|null
* @var array<int, string>|string|null
*/
protected $proxies;
@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @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;
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

@ -9,7 +9,7 @@ class VerifyCsrfToken extends Middleware
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
* @var array<int, string>
*/
protected $except = [
//

View file

@ -6,18 +6,19 @@ use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Hash;
use App\Traits\Timestamp;
class User extends Authenticatable
{
use HasFactory, Notifiable;
use HasApiTokens, HasFactory, Notifiable;
use Timestamp;
/**
* The attributes that are mass assignable.
*
* @var array
* @var array<int, string>
*/
protected $fillable = [
'name',
@ -27,9 +28,9 @@ class User extends Authenticatable
];
/**
* The attributes that should be hidden for arrays.
* The attributes that should be hidden for serialization.
*
* @var array
* @var array<int, string>
*/
protected $hidden = [
'password',
@ -38,9 +39,9 @@ class User extends Authenticatable
];
/**
* The attributes that should be cast to native types.
* The attributes that should be cast.
*
* @var array
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',

View file

@ -8,9 +8,9 @@ use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
* The model to policy mappings for the application.
*
* @var array
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',

View file

@ -10,9 +10,9 @@ use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
* The event to listener mappings for the application.
*
* @var array
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
@ -29,4 +29,14 @@ class EventServiceProvider extends ServiceProvider
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}

View file

@ -10,35 +10,17 @@ use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/dashboard';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
* Define your route model bindings, pattern filters, and other route configuration.
*
* @return void
*/
@ -47,13 +29,11 @@ class RouteServiceProvider extends ServiceProvider
$this->configureRateLimiting();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
@ -66,7 +46,7 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
}
}

View file

@ -5,28 +5,26 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"doctrine/dbal": "^2.10",
"erusev/parsedown": "^1.7",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.5",
"laravel/framework": "^8.40",
"laravel/helpers": "^1.2",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.3.0",
"phpoffice/phpspreadsheet": "^1.14",
"radic/blade-extensions": "^7.4.0",
"spatie/laravel-newsletter": "^4.8"
"php": "^8.0.2",
"doctrine/dbal": "^3.3.6",
"erusev/parsedown": "^1.7.4",
"guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.7.2",
"laravel/framework": "^9.11",
"laravel/helpers": "^1.5",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"laravel/ui": "^3.5.4",
"phpoffice/phpspreadsheet": "^1.23.0",
"spatie/laravel-newsletter": "^4.11.0"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
@ -46,7 +44,7 @@
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi"
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""

2120
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,7 @@
<?php
use Illuminate\Support\Facades\Facade;
return [
/*
@ -54,7 +56,7 @@ return [
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
@ -123,6 +125,24 @@ return [
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
@ -178,7 +198,6 @@ return [
/*
* Custom Service Providers...
*/
Radic\BladeExtensions\BladeExtensionsServiceProvider::class,
Spatie\Newsletter\NewsletterServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
@ -195,54 +214,10 @@ return [
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
/*
* Custom Class Aliases...
*/
'Image' => Intervention\Image\Facades\Image::class,
'Language' => App\Utilities\Language::class,
'Version' => App\Utilities\Version::class,
]
'aliases' => Facade::defaultAliases()->merge([
'Image' => Intervention\Image\Facades\Image::class,
'Language' => App\Utilities\Language::class,
'Version' => App\Utilities\Version::class,
])->toArray(),
];

View file

@ -31,7 +31,7 @@ return [
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
| Supported: "session"
|
*/
@ -40,12 +40,6 @@ return [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
/*
@ -86,7 +80,7 @@ return [
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| The expire time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|

View file

@ -1,66 +0,0 @@
<?php
/**
* Copyright (c) 2017. Robin Radic.
*
* The license can be found in the package and online at https://radic.mit-license.org.
*
* @copyright 2017 Robin Radic
* @license https://radic.mit-license.org MIT License
* @version 7.0.0 Radic\BladeExtensions
*/
return [
'directives' => [
'set' => 'Radic\\BladeExtensions\\Directives\\SetDirective',
'unset' => 'Radic\\BladeExtensions\\Directives\\UnsetDirective',
'breakpoint' => 'Radic\\BladeExtensions\\Directives\\BreakpointDirective',
'dump' => 'Radic\\BladeExtensions\\Directives\\DumpDirective',
'foreach' => 'Radic\\BladeExtensions\\Directives\\ForeachDirective',
'endforeach' => 'Radic\\BladeExtensions\\Directives\\EndforeachDirective',
'break' => 'Radic\\BladeExtensions\\Directives\\BreakDirective',
'continue' => 'Radic\\BladeExtensions\\Directives\\ContinueDirective',
'embed' => 'Radic\\BladeExtensions\\Directives\\EmbedDirective'
// 'closure' => function ($value) {
// return $value;
// },
],
// `optional` directives are only used for **unit-testing**
// If you want to use any of the `optional` directives, you have to **manually copy/paste** them to `directives`.
'optional' => [
'macro' => 'Radic\\BladeExtensions\\Directives\\MacroDirective',
'endmacro' => 'Radic\\BladeExtensions\\Directives\\EndmacroDirective',
'macrodef' => 'Radic\\BladeExtensions\\Directives\\MacrodefDirective',
'markdown' => 'Radic\\BladeExtensions\\Directives\\MarkdownDirective',
'endmarkdown' => 'Radic\\BladeExtensions\\Directives\\EndmarkdownDirective',
'minify' => 'Radic\\BladeExtensions\\Directives\\MinifyDirective',
'endminify' => 'Radic\\BladeExtensions\\Directives\\EndminifyDirective',
'spaceless' => 'Radic\\BladeExtensions\\Directives\\SpacelessDirective',
'endspaceless' => 'Radic\\BladeExtensions\\Directives\\EndspacelessDirective',
'ifsection' => 'Radic\\BladeExtensions\\Directives\\IfSectionDirective',
'elseifsection' => 'Radic\\BladeExtensions\\Directives\\ElseIfSectionDirective',
'endifsection' => 'Radic\\BladeExtensions\\Directives\\EndIfSectionDirective',
],
'version_overrides' => [
// 5.2 introduced @break and @continue
// but blade-extensions's @foreach relies on them so we don't yet disable them
// 5.3 introduced the loop variable for the @foreach directive. we can disable these.
// NOTE: If you have used blade-extensions's @foreach before blade-extensions:7.0.0, you probably want to remove this
// TL:DR: upgrading to blade-extension 7.0.0? then remove this
'>=5.3' => [
'break' => null,
'continue' => null,
'foreach' => null,
'endforeach' => null,
],
],
];

View file

@ -39,6 +39,9 @@ return [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [

View file

@ -99,12 +99,12 @@ return [
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| stores there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'hypothetical'), '_').'_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

View file

@ -74,7 +74,7 @@ return [
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'search_path' => 'public',
'sslmode' => 'prefer',
],
@ -89,6 +89,8 @@ return [
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
@ -129,7 +131,8 @@ return [
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
@ -137,7 +140,8 @@ return [
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],

View file

@ -13,7 +13,7 @@ return [
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
@ -22,7 +22,7 @@ return [
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
| been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
@ -33,6 +33,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
@ -40,6 +41,7 @@ return [
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
's3' => [
@ -51,6 +53,7 @@ return [
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
],

View file

@ -44,9 +44,9 @@ return [
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
'memory' => 65536,
'threads' => 1,
'time' => 4,
],
];

View file

@ -19,6 +19,22 @@ return [
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => false,
],
/*
|--------------------------------------------------------------------------
| Log Channels
@ -65,10 +81,11 @@ return [
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
],

View file

@ -29,7 +29,7 @@ return [
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
| "postmark", "log", "array", "failover"
|
*/
@ -42,7 +42,7 @@ return [
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
'ses' => [
@ -59,7 +59,7 @@ return [
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
@ -70,6 +70,14 @@ return [
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
],
/*

67
config/sanctum.php Normal file
View file

@ -0,0 +1,67 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. If this value is null, personal access tokens do
| not expire. This won't tweak the lifetime of first-party sessions.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
],
];

View file

@ -18,6 +18,7 @@ return [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
'scheme' => 'https',
],
'postmark' => [

View file

@ -72,7 +72,7 @@ return [
|
*/
'connection' => env('SESSION_CONNECTION', null),
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
@ -100,7 +100,7 @@ return [
|
*/
'store' => env('SESSION_STORE', null),
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
@ -128,7 +128,7 @@ return [
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'hypothetical'), '_').'_session'
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
@ -155,7 +155,7 @@ return [
|
*/
'domain' => env('SESSION_DOMAIN', null),
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------

View file

@ -2,23 +2,18 @@
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class;
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
{
@ -34,7 +29,7 @@ class UserFactory extends Factory
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
* @return static
*/
public function unverified()
{

View file

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -39,4 +39,4 @@ class CreateUsersTable extends Migration
{
Schema::dropIfExists('users');
}
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ class CreatePasswordResetsTable extends Migration
{
Schema::dropIfExists('password_resets');
}
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddContactTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ class AddContactTable extends Migration
{
Schema::drop('contact');
}
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSubscriptionTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -30,4 +30,4 @@ class AddSubscriptionTable extends Migration
{
Schema::drop('subscriptions');
}
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBlogTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ class AddBlogTable extends Migration
{
Schema::drop('blog');
}
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -33,4 +33,4 @@ class CreateFailedJobsTable extends Migration
{
Schema::dropIfExists('failed_jobs');
}
}
};

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
};

View file

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddBlogTagsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ class AddBlogTagsTable extends Migration
{
Schema::drop('blog_tags');
}
}
};

View file

@ -2,6 +2,7 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
@ -15,5 +16,10 @@ class DatabaseSeeder extends Seeder
public function run()
{
// \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
}
}

19
init.sh
View file

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# The PHP version to use
PHP_BINARY=${PHP_BINARY:=/usr/bin/php}
# Dependencies
deps=('composer' 'grep' 'npm' 'php' 'sed')
@ -61,32 +64,32 @@ trap 'error "script killed"' SIGINT SIGQUIT
[[ -d vendor ]] && {
artisan_down=1
msg "Running: ${c_m}php artisan down"
php artisan down
$PHP_BINARY artisan down
}
msg "Running: ${c_m}composer installl --no-dev"
composer install --no-interaction --no-dev || error "${c_m}composer install --no-interaction --no-dev$c_w exited with an error status"
$PHP_BINARY "$(type -P composer)" install --no-interaction --no-dev || error "${c_m}composer install --no-interaction --no-dev$c_w exited with an error status"
while read -r; do
[[ "$REPLY" =~ ^APP_KEY=(.*)$ && -z "${BASH_REMATCH[1]}" ]] && {
msg 'Generating Encryption Key' 'php artisan key:generate'
php artisan key:generate
$PHP_BINARY artisan key:generate
break
}
done < .env
msg "Running: ${c_m}php artisan route:clear"
php artisan cache:clear
$PHP_BINARY artisan cache:clear
msg "Running: ${c_m}php artisan route:clear"
php artisan route:clear
$PHP_BINARY artisan route:clear
msg "Running: ${c_m}php artisan view:clear"
php artisan view:clear
$PHP_BINARY artisan view:clear
(( ! no_db )) && {
msg "Running: ${c_m}php artisan migrate --force"
php artisan migrate --force || error "${c_m}php artisan migrate --force$c_w exited with an error status"
$PHP_BINARY artisan migrate --force || error "${c_m}php artisan migrate --force$c_w exited with an error status"
}
[[ -d node_modules ]] && {
@ -102,5 +105,5 @@ NODE_ENV=production "$(npm bin)/gulp" --production || error "${c_m}gulp --produc
if (( artisan_down )); then
msg "Running: ${c_m}php artisan up"
php artisan up
$PHP_BINARY artisan up
fi

View file

@ -14,6 +14,7 @@ return [
*/
'accepted' => 'The :attribute must be accepted.',
'accepted_if' => 'The :attribute must be accepted when :other is :value.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
@ -24,10 +25,10 @@ return [
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
'numeric' => 'The :attribute must be between :min and :max.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
'string' => 'The :attribute must be between :min and :max characters.',
'array' => 'The :attribute must have between :min and :max items.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
'numeric' => 'The :attribute must be between :min and :max.',
'string' => 'The :attribute must be between :min and :max characters.',
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
@ -35,6 +36,8 @@ return [
'date' => 'The :attribute is not a valid date.',
'date_equals' => 'The :attribute must be a date equal to :date.',
'date_format' => 'The :attribute does not match the format :format.',
'declined' => 'The :attribute must be declined.',
'declined_if' => 'The :attribute must be declined when :other is :value.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
@ -42,20 +45,21 @@ return [
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'enum' => 'The selected :attribute is invalid.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
'gt' => [
'numeric' => 'The :attribute must be greater than :value.',
'file' => 'The :attribute must be greater than :value kilobytes.',
'string' => 'The :attribute must be greater than :value characters.',
'array' => 'The :attribute must have more than :value items.',
'file' => 'The :attribute must be greater than :value kilobytes.',
'numeric' => 'The :attribute must be greater than :value.',
'string' => 'The :attribute must be greater than :value characters.',
],
'gte' => [
'numeric' => 'The :attribute must be greater than or equal :value.',
'file' => 'The :attribute must be greater than or equal :value kilobytes.',
'string' => 'The :attribute must be greater than or equal :value characters.',
'array' => 'The :attribute must have :value items or more.',
'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
'numeric' => 'The :attribute must be greater than or equal to :value.',
'string' => 'The :attribute must be greater than or equal to :value characters.',
],
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
@ -66,54 +70,63 @@ return [
'ipv6' => 'The :attribute must be a valid IPv6 address.',
'json' => 'The :attribute must be a valid JSON string.',
'lt' => [
'numeric' => 'The :attribute must be less than :value.',
'file' => 'The :attribute must be less than :value kilobytes.',
'string' => 'The :attribute must be less than :value characters.',
'array' => 'The :attribute must have less than :value items.',
'file' => 'The :attribute must be less than :value kilobytes.',
'numeric' => 'The :attribute must be less than :value.',
'string' => 'The :attribute must be less than :value characters.',
],
'lte' => [
'numeric' => 'The :attribute must be less than or equal :value.',
'file' => 'The :attribute must be less than or equal :value kilobytes.',
'string' => 'The :attribute must be less than or equal :value characters.',
'array' => 'The :attribute must not have more than :value items.',
'file' => 'The :attribute must be less than or equal to :value kilobytes.',
'numeric' => 'The :attribute must be less than or equal to :value.',
'string' => 'The :attribute must be less than or equal to :value characters.',
],
'mac_address' => 'The :attribute must be a valid MAC address.',
'max' => [
'numeric' => 'The :attribute must not be greater than :max.',
'file' => 'The :attribute must not be greater than :max kilobytes.',
'string' => 'The :attribute must not be greater than :max characters.',
'array' => 'The :attribute must not have more than :max items.',
'file' => 'The :attribute must not be greater than :max kilobytes.',
'numeric' => 'The :attribute must not be greater than :max.',
'string' => 'The :attribute must not be greater than :max characters.',
],
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
'min' => [
'numeric' => 'The :attribute must be at least :min.',
'file' => 'The :attribute must be at least :min kilobytes.',
'string' => 'The :attribute must be at least :min characters.',
'array' => 'The :attribute must have at least :min items.',
'file' => 'The :attribute must be at least :min kilobytes.',
'numeric' => 'The :attribute must be at least :min.',
'string' => 'The :attribute must be at least :min characters.',
],
'multiple_of' => 'The :attribute must be a multiple of :value.',
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
'password' => 'The password is incorrect.',
'password' => [
'letters' => 'The :attribute must contain at least one letter.',
'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.',
'numbers' => 'The :attribute must contain at least one number.',
'symbols' => 'The :attribute must contain at least one symbol.',
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
],
'present' => 'The :attribute field must be present.',
'prohibited' => 'The :attribute field is prohibited.',
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
'prohibits' => 'The :attribute field prohibits :other from being present.',
'regex' => 'The :attribute format is invalid.',
'required' => 'The :attribute field is required.',
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
'required_if' => 'The :attribute field is required when :other is :value.',
'required_unless' => 'The :attribute field is required unless :other is in :values.',
'required_with' => 'The :attribute field is required when :values is present.',
'required_with_all' => 'The :attribute field is required when :values are present.',
'required_without' => 'The :attribute field is required when :values is not present.',
'required_without_all' => 'The :attribute field is required when none of :values are present.',
'prohibited' => 'The :attribute field is prohibited.',
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
'same' => 'The :attribute and :other must match.',
'size' => [
'numeric' => 'The :attribute must be :size.',
'file' => 'The :attribute must be :size kilobytes.',
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
'file' => 'The :attribute must be :size kilobytes.',
'numeric' => 'The :attribute must be :size.',
'string' => 'The :attribute must be :size characters.',
],
'starts_with' => 'The :attribute must start with one of the following: :values.',
'string' => 'The :attribute must be a string.',

View file

@ -18,14 +18,14 @@
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<!-- <server name="DB_CONNECTION" value="sqlite"/> -->
<!-- <server name="DB_DATABASE" value=":memory:"/> -->
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>

View file

@ -16,8 +16,8 @@ define('LARAVEL_START', microtime(true));
|
*/
if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
require __DIR__.'/../storage/framework/maintenance.php';
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
/*
@ -48,8 +48,8 @@ $app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Kernel::class);
$response = tap($kernel->handle(
$response = $kernel->handle(
$request = Request::capture()
))->send();
)->send();
$kernel->terminate($request, $response);

View file

@ -1,28 +0,0 @@
<!--
Rewrites requires Microsoft URL Rewrite Module for IIS
Download: https://www.iis.net/downloads/microsoft/url-rewrite
Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
-->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

View file

@ -3,7 +3,7 @@
A Hypothetical website template for bootstrapping new projects.
* Written and maintained by Kevin MacMartin
* Based on Laravel 8.5.23
* Based on Laravel 9.1.8
## Setup

View file

@ -19,9 +19,11 @@
<div class="container-fluid">
@foreach($columns as $column)
<div class="row">
@set('value', $item !== null ? $item[$column['name']] : '')
@set('type', $id == 'new' && array_key_exists('type-new', $column) ? $column['type-new'] : $column['type'])
@set('ext', array_key_exists('ext', $column) ? $column['ext'] : 'jpg')
@php
$value = $item !== null ? $item[$column['name']] : '';
$type = $id == 'new' && array_key_exists('type-new', $column) ? $column['type-new'] : $column['type'];
$ext = array_key_exists('ext', $column) ? $column['ext'] : 'jpg';
@endphp
@if($type == 'hidden')
<input class="text-input" type="hidden" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}" />
@ -59,11 +61,15 @@
<select class="text-input" name="{{ $column['name'] }}" id="{{ $column['name'] }}">
@foreach($column['options'] as $option)
@if(is_array($option))
@set('select_value', $option['value'])
@set('select_title', $option['title'])
@php
$select_value = $option['value'];
$select_title = $option['title'];
@endphp
@else
@set('select_value', $option)
@set('select_title', $option)
@php
$select_value = $option;
$select_title = $option;
@endphp
@endif
@if($select_value === $value)
@ -111,7 +117,10 @@
<button class="list-add-button" type="button">Add</button>
</div>
@elseif($type == 'image')
@set('current_image', "/uploads/$model/img/$id-" . $column['name'] . '.' . $ext)
@php
$current_image = "/uploads/$model/img/$id-" . $column['name'] . '.' . $ext;
@endphp
<input class="image-upload" type="file" name="{{ $column['name'] }}" id="{{ $column['name'] }}" />
@if(file_exists(base_path() . '/public' . $current_image))
@ -126,7 +135,10 @@
</div>
@endif
@elseif($type == 'file')
@set('current_file', "/uploads/$model/files/$id-" . $column['name'] . '.' . $column['ext'])
@php
$current_file = "/uploads/$model/files/$id-" . $column['name'] . '.' . $column['ext'];
@endphp
<input class="file-upload" type="file" name="{{ $column['name'] }}" id="{{ $column['name'] }}" />
@if(file_exists(base_path() . '/public' . $current_file))

View file

@ -54,13 +54,19 @@
</a>
<div class="pagination-navigation-bar-page-count">
@set('pages_around', 2)
@set('start_page', $rows->currentPage() - $pages_around)
@php
$pages_around = 2;
$start_page = $rows->currentPage() - $pages_around;
@endphp
@if($start_page < 1)
@set('start_page', 1)
@php
$start_page = 1;
@endphp
@elseif($start_page + $pages_around > $rows->lastPage())
@set('start_page', $rows->lastPage() - $pages_around)
@php
$start_page = $rows->lastPage() - $pages_around;
@endphp
@endif
@if($start_page > 1)
@ -121,11 +127,11 @@
</div>
@endif
@foreach($display as $display_column)
@foreach($display as $index => $display_column)
@if($row[$display_column] != '')
<div class="column">{{ $row[$display_column] }}</div>
@if(!$loop->last)
@if($index < count($display) - 1)
<div class="spacer">|</div>
@endif
@endif

View file

@ -10,8 +10,11 @@
<div class="col-12">
<div class="dashboard-settings-container">
<form id="user-profile-image" class="user-profile-image">
@set('profile_image', $user->profileImage())
@set('default_image', App\Models\User::$default_profile_image)
@php
$profile_image = $user->profileImage();
$default_image = App\Models\User::$default_profile_image;
@endphp
<h2 class="form-title">Profile Image</h2>
<div

View file

@ -31,7 +31,9 @@
@else
@foreach(App\Dashboard::$menu as $menu_item)
@if(array_key_exists('submenu', $menu_item))
@set('dropdown_id', preg_replace([ '/\ \ */', '/[^a-z\-]/' ], [ '-', '' ], strtolower($menu_item['title'])))
@php
$dropdown_id = preg_replace([ '/\ \ */', '/[^a-z\-]/' ], [ '-', '' ], strtolower($menu_item['title']));
@endphp
<li class="nav-item dropdown">
<button

View file

@ -1,7 +1,9 @@
<!DOCTYPE html>
<html lang="{{ Language::getSessionLanguage() }}">
@set('page_title', (isset($title) ? $title . ' - ' : '') . env('APP_NAME'))
@set('device_mobile', preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent')))
@php
$page_title = (isset($title) ? $title . ' - ' : '') . env('APP_NAME');
$device_mobile = preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent'));
@endphp
<head>
<meta charset="UTF-8" />

View file

@ -1,5 +1,8 @@
@extends('templates.base', [ 'title' => 'Dashboard' ])
@set('current_page', preg_match('/\/settings$/', Request::url()) ? 'settings' : preg_replace([ '/https?:\/\/[^\/]*\/dashboard\/[^\/]*\//', '/\/.*/' ], [ '', '' ], Request::url()))
@php
$current_page = preg_match('/\/settings$/', Request::url()) ? 'settings' : preg_replace([ '/https?:\/\/[^\/]*\/dashboard\/[^\/]*\//', '/\/.*/' ], [ '', '' ], Request::url());
@endphp
@section('page-includes')
<script src="/js/lib-dashboard.js?version={{ Version::get() }}"></script>

View file

@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::middleware('auth:api')->get('/user', function(Request $request) {
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});

View file

@ -2,7 +2,6 @@
use Illuminate\Support\Facades\Route;
use App\Dashboard;
use App\Utilities\Language;
/*
|--------------------------------------------------------------------------

View file

@ -1,21 +0,0 @@
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
require_once __DIR__.'/public/index.php';

View file

@ -12,7 +12,7 @@ class ExampleTest extends TestCase
*
* @return void
*/
public function test_example()
public function test_the_application_returns_a_successful_response()
{
$response = $this->get('/');

View file

@ -11,7 +11,7 @@ class ExampleTest extends TestCase
*
* @return void
*/
public function test_example()
public function test_that_true_is_true()
{
$this->assertTrue(true);
}

View file

@ -2,7 +2,6 @@
use Illuminate\Support\Facades\Route;
use App\Dashboard;
use App\Utilities\Language;
/*
|--------------------------------------------------------------------------