Merge pull request #551 from jonnybarnes/develop

MTM Improve Media Endpoint
This commit is contained in:
Jonny Barnes 2022-11-18 17:32:39 +00:00 committed by GitHub
commit 0cd6f81a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 771 additions and 513 deletions

View file

@ -1,45 +1,63 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_ENV=production APP_ENV=local
APP_KEY=SomeRandomString # Leave this APP_KEY=
APP_DEBUG=false APP_DEBUG=true
APP_LOG_LEVEL=warning APP_URL=https://example.com
APP_LONGURL=example.com
APP_SHORTURL=examp.le
DB_CONNECTION=pgsql LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
DB_PORT=5432 DB_PORT=3306
DB_DATABASE= DB_DATABASE=laravel
DB_USERNAME= DB_USERNAME=root
DB_PASSWORD= DB_PASSWORD=
BROADCAST_DRIVER=log BROADCAST_DRIVER=log
CACHE_DRIVER=file CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file SESSION_DRIVER=file
QUEUE_DRIVER=sync SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1 REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_DRIVER=smtp MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io MAIL_HOST=mailhog
MAIL_PORT=2525 MAIL_PORT=1025
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_ENCRYPTION=null MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID= PUSHER_APP_ID=
PUSHER_APP_KEY= PUSHER_APP_KEY=
PUSHER_APP_SECRET= PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
AWS_S3_KEY=your-key VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
AWS_S3_SECRET=your-secret VITE_PUSHER_HOST="${PUSHER_HOST}"
AWS_S3_REGION=region VITE_PUSHER_PORT="${PUSHER_PORT}"
AWS_S3_BUCKET=your-bucket VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
AWS_S3_URL=https://xxxxxxx.s3-region.amazonaws.com VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
APP_URL=https://example.com # This one is necessary
APP_LONGURL=example.com
APP_SHORTURL=examp.le
ADMIN_USER=admin# pick something better, this is used for `/admin` ADMIN_USER=admin# pick something better, this is used for `/admin`
ADMIN_PASS=password ADMIN_PASS=password

View file

@ -1,6 +1,7 @@
{ {
"extends": ["stylelint-config-standard"], "extends": ["stylelint-config-standard"],
"rules": { "rules": {
"indentation": 4 "indentation": 4,
"import-notation": "string"
} }
} }

View file

@ -10,9 +10,9 @@ use App\Models\Media;
use App\Services\TokenService; use App\Services\TokenService;
use Exception; use Exception;
use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\File; use Illuminate\Http\File;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
@ -33,11 +33,11 @@ class MicropubMediaController extends Controller
$this->tokenService = $tokenService; $this->tokenService = $tokenService;
} }
public function getHandler(): JsonResponse public function getHandler(Request $request): JsonResponse
{ {
try { try {
$tokenData = $this->tokenService->validateToken(request()->input('access_token')); $tokenData = $this->tokenService->validateToken($request->input('access_token'));
} catch (RequiredConstraintsViolated | InvalidTokenStructure $exception) { } catch (RequiredConstraintsViolated | InvalidTokenStructure) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->invalidTokenResponse(); return $micropubResponses->invalidTokenResponse();
@ -55,19 +55,19 @@ class MicropubMediaController extends Controller
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();
} }
if (request()->input('q') === 'last') { if ($request->input('q') === 'last') {
try { $media = Media::where('created_at', '>=', Carbon::now()->subMinutes(30))
$media = Media::latest()->whereDate('created_at', '>=', Carbon::now()->subMinutes(30))->firstOrFail(); ->where('token', $request->input('access_token'))
} catch (ModelNotFoundException $exception) { ->latest()
return response()->json(['url' => null]); ->first();
$mediaUrl = $media?->url;
return response()->json(['url' => $mediaUrl]);
} }
return response()->json(['url' => $media->url]); if ($request->input('q') === 'source') {
} $limit = $request->input('limit', 10);
$offset = $request->input('offset', 0);
if (request()->input('q') === 'source') {
$limit = request()->input('limit', 10);
$offset = request()->input('offset', 0);
$media = Media::latest()->offset($offset)->limit($limit)->get(); $media = Media::latest()->offset($offset)->limit($limit)->get();
@ -80,12 +80,12 @@ class MicropubMediaController extends Controller
return response()->json(['items' => $media]); return response()->json(['items' => $media]);
} }
if (request()->has('q')) { if ($request->has('q')) {
return response()->json([ return response()->json([
'error' => 'invalid_request', 'error' => 'invalid_request',
'error_description' => sprintf( 'error_description' => sprintf(
'This server does not know how to handle this q parameter (%s)', 'This server does not know how to handle this q parameter (%s)',
request()->input('q') $request->input('q')
), ),
], 400); ], 400);
} }

View file

@ -22,6 +22,7 @@
"jublonet/codebird-php": "4.0.0-beta.1", "jublonet/codebird-php": "4.0.0-beta.1",
"laravel/framework": "^9.0", "laravel/framework": "^9.0",
"laravel/horizon": "^5.0", "laravel/horizon": "^5.0",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.0", "laravel/tinker": "^2.0",
"lcobucci/jwt": "^4.0", "lcobucci/jwt": "^4.0",
"league/commonmark": "^2.0", "league/commonmark": "^2.0",

538
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Facade;
return [ return [
/* /*
@ -54,7 +56,7 @@ return [
'url' => env('APP_URL', 'http://localhost'), 'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null), 'asset_url' => env('ASSET_URL'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -169,15 +171,30 @@ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Font Link | Maintenance Mode Driver
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| If you have a css link to Adobes Typekit or Hoefler&Cos Typography | These configuration options determine the driver used to determine and
| then specify the link here. | manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
| |
*/ */
'font_link' => env('FONT_LINK', null), 'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Font Link
|--------------------------------------------------------------------------
| Which URL should the app load custom fonts from
*/
'font_link' => env('FONT_LINK'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -245,47 +262,8 @@ return [
| |
*/ */
'aliases' => [ 'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
'App' => Illuminate\Support\Facades\App::class, ])->toArray(),
'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,
'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,
'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,
],
'piwik' => env('PIWIK', false),
]; ];

View file

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

View file

@ -11,7 +11,7 @@ return [
| framework when an event needs to be broadcast. You may set this to | framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below. | any of the connections defined in the "connections" array below.
| |
| Supported: "pusher", "redis", "log", "null" | Supported: "pusher", "ably", "redis", "log", "null"
| |
*/ */
@ -36,9 +36,20 @@ return [
'secret' => env('PUSHER_APP_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'), 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'useTLS' => true, 'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
], ],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
], ],
'redis' => [ 'redis' => [

View file

@ -13,9 +13,6 @@ return [
| using this caching library. This connection is used when another is | using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function. | not explicitly specified when executing a given caching function.
| |
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/ */
'default' => env('CACHE_DRIVER', 'file'), 'default' => env('CACHE_DRIVER', 'file'),
@ -29,6 +26,9 @@ return [
| well as their drivers. You may even define multiple stores for the | well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches. | same cache driver to group types of items stored in your caches.
| |
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/ */
'stores' => [ 'stores' => [
@ -46,6 +46,7 @@ return [
'driver' => 'database', 'driver' => 'database',
'table' => 'cache', 'table' => 'cache',
'connection' => null, 'connection' => null,
'lock_connection' => null,
], ],
'file' => [ 'file' => [
@ -75,6 +76,7 @@ return [
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'cache', 'connection' => 'cache',
'lock_connection' => 'default',
], ],
'dynamodb' => [ 'dynamodb' => [
@ -86,6 +88,10 @@ return [
'endpoint' => env('DYNAMODB_ENDPOINT'), 'endpoint' => env('DYNAMODB_ENDPOINT'),
], ],
'octane' => [
'driver' => 'octane',
],
], ],
/* /*
@ -93,12 +99,12 @@ return [
| Cache Key Prefix | Cache Key Prefix
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When utilizing a RAM based store such as APC or Memcached, there might | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| be other applications utilizing the same cache. So, we'll specify a | stores there might be other applications using the same cache. For
| value to get prefixed to all our keys so we can avoid collisions. | that reason, you may prefix every cache key to avoid collisions.
| |
*/ */
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
]; ];

34
config/cors.php Normal file
View file

@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];

View file

@ -89,6 +89,8 @@ return [
'charset' => 'utf8', 'charset' => 'utf8',
'prefix' => '', 'prefix' => '',
'prefix_indexes' => true, 'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
], ],
], ],
@ -129,7 +131,8 @@ return [
'default' => [ 'default' => [
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), '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'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'), 'database' => env('REDIS_DB', '0'),
], ],
@ -137,7 +140,8 @@ return [
'cache' => [ 'cache' => [
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), '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'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'), 'database' => env('REDIS_CACHE_DB', '1'),
], ],

View file

@ -13,20 +13,7 @@ return [
| |
*/ */
'default' => env('FILESYSTEM_DRIVER', 'local'), 'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -35,7 +22,7 @@ return [
| |
| Here you may configure as many filesystem "disks" as you wish, and you | Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have | 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" | Supported Drivers: "local", "ftp", "sftp", "s3"
| |
@ -46,6 +33,7 @@ return [
'local' => [ 'local' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app'), 'root' => storage_path('app'),
'throw' => false,
], ],
'public' => [ 'public' => [
@ -53,6 +41,7 @@ return [
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage', 'url' => env('APP_URL').'/storage',
'visibility' => 'public', 'visibility' => 'public',
'throw' => false,
], ],
's3' => [ 's3' => [
@ -63,11 +52,8 @@ return [
'bucket' => env('AWS_BUCKET'), 'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'), 'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'), 'endpoint' => env('AWS_ENDPOINT'),
], 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'media' => [
'driver' => 'local',
'root' => public_path() . '/media',
], ],
], ],

View file

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

View file

@ -19,6 +19,22 @@ return [
'default' => env('LOG_CHANNEL', 'stack'), '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 | Log Channels
@ -65,15 +81,17 @@ return [
'papertrail' => [ 'papertrail' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class, 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [ 'handler_with' => [
'host' => env('PAPERTRAIL_URL'), 'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'), 'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
], ],
], ],
'stderr' => [ 'stderr' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'), 'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [ 'with' => [

View file

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

View file

@ -39,6 +39,7 @@ return [
'table' => 'jobs', 'table' => 'jobs',
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'after_commit' => false,
], ],
'beanstalkd' => [ 'beanstalkd' => [
@ -47,6 +48,7 @@ return [
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'block_for' => 0, 'block_for' => 0,
'after_commit' => false,
], ],
'sqs' => [ 'sqs' => [
@ -54,9 +56,10 @@ return [
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'), 'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'), 'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
], ],
'redis' => [ 'redis' => [
@ -65,6 +68,7 @@ return [
'queue' => env('REDIS_QUEUE', 'default'), 'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90, 'retry_after' => 90,
'block_for' => null, 'block_for' => null,
'after_commit' => false,
], ],
], ],

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'), 'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'), 'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
'scheme' => 'https',
], ],
'postmark' => [ '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'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -155,7 +155,7 @@ return [
| |
*/ */
'domain' => env('SESSION_DOMAIN', null), 'domain' => env('SESSION_DOMAIN'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -164,7 +164,7 @@ return [
| |
| By setting this option to true, session cookies will only be sent back | By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep | to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely. | the cookie from being sent to you when it can't be done securely.
| |
*/ */

283
package-lock.json generated
View file

@ -19,21 +19,21 @@
"babel-loader": "^9.1.0", "babel-loader": "^9.1.0",
"browserlist": "^1.0.1", "browserlist": "^1.0.1",
"compression-webpack-plugin": "^10.0.0", "compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.2.0", "css-loader": "^6.7.2",
"cssnano": "^5.1.14", "cssnano": "^5.1.14",
"eslint": "^8.27.0", "eslint": "^8.27.0",
"eslint-webpack-plugin": "^3.2.0", "eslint-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^2.6.1", "mini-css-extract-plugin": "^2.7.0",
"postcss": "^8.4.18", "postcss": "^8.4.19",
"postcss-combine-duplicated-selectors": "^10.0.2", "postcss-combine-duplicated-selectors": "^10.0.2",
"postcss-combine-media-query": "^1.0.1", "postcss-combine-media-query": "^1.0.1",
"postcss-import": "^15.0.0", "postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1", "postcss-loader": "^7.0.1",
"stylelint": "^14.14.1", "stylelint": "^14.15.0",
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^29.0.0",
"stylelint-webpack-plugin": "^3.1.1", "stylelint-webpack-plugin": "^3.1.1",
"webpack": "^5.74.0", "webpack": "^5.75.0",
"webpack-cli": "^4.10.0" "webpack-cli": "^5.0.0"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
@ -2064,34 +2064,42 @@
} }
}, },
"node_modules/@webpack-cli/configtest": { "node_modules/@webpack-cli/configtest": {
"version": "1.2.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.0.tgz",
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", "integrity": "sha512-war4OU8NGjBqU3DP3bx6ciODXIh7dSXcpQq+P4K2Tqyd8L5OjZ7COx9QXx/QdCIwL2qoX09Wr4Cwf7uS4qdEng==",
"dev": true, "dev": true,
"engines": {
"node": ">=14.15.0"
},
"peerDependencies": { "peerDependencies": {
"webpack": "4.x.x || 5.x.x", "webpack": "5.x.x",
"webpack-cli": "4.x.x" "webpack-cli": "5.x.x"
} }
}, },
"node_modules/@webpack-cli/info": { "node_modules/@webpack-cli/info": {
"version": "1.5.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.0.tgz",
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", "integrity": "sha512-NNxDgbo4VOkNhOlTgY0Elhz3vKpOJq4/PKeKg7r8cmYM+GQA9vDofLYyup8jS6EpUvhNmR30cHTCEIyvXpskwA==",
"dev": true, "dev": true,
"dependencies": { "engines": {
"envinfo": "^7.7.3" "node": ">=14.15.0"
}, },
"peerDependencies": { "peerDependencies": {
"webpack-cli": "4.x.x" "webpack": "5.x.x",
"webpack-cli": "5.x.x"
} }
}, },
"node_modules/@webpack-cli/serve": { "node_modules/@webpack-cli/serve": {
"version": "1.7.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.0.tgz",
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", "integrity": "sha512-Rumq5mHvGXamnOh3O8yLk1sjx8dB30qF1OeR6VC00DIR6SLJ4bwwUGKC4pE7qBFoQyyh0H9sAg3fikYgAqVR0w==",
"dev": true, "dev": true,
"engines": {
"node": ">=14.15.0"
},
"peerDependencies": { "peerDependencies": {
"webpack-cli": "4.x.x" "webpack": "5.x.x",
"webpack-cli": "5.x.x"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"webpack-dev-server": { "webpack-dev-server": {
@ -2757,19 +2765,19 @@
} }
}, },
"node_modules/css-loader": { "node_modules/css-loader": {
"version": "6.7.1", "version": "6.7.2",
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.1.tgz", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.2.tgz",
"integrity": "sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw==", "integrity": "sha512-oqGbbVcBJkm8QwmnNzrFrWTnudnRZC+1eXikLJl0n4ljcfotgRifpg2a1lKy8jTrc4/d9A/ap1GFq1jDKG7J+Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"icss-utils": "^5.1.0", "icss-utils": "^5.1.0",
"postcss": "^8.4.7", "postcss": "^8.4.18",
"postcss-modules-extract-imports": "^3.0.0", "postcss-modules-extract-imports": "^3.0.0",
"postcss-modules-local-by-default": "^4.0.0", "postcss-modules-local-by-default": "^4.0.0",
"postcss-modules-scope": "^3.0.0", "postcss-modules-scope": "^3.0.0",
"postcss-modules-values": "^4.0.0", "postcss-modules-values": "^4.0.0",
"postcss-value-parser": "^4.2.0", "postcss-value-parser": "^4.2.0",
"semver": "^7.3.5" "semver": "^7.3.8"
}, },
"engines": { "engines": {
"node": ">= 12.13.0" "node": ">= 12.13.0"
@ -2783,9 +2791,9 @@
} }
}, },
"node_modules/css-loader/node_modules/semver": { "node_modules/css-loader/node_modules/semver": {
"version": "7.3.7", "version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@ -4090,12 +4098,12 @@
"dev": true "dev": true
}, },
"node_modules/interpret": { "node_modules/interpret": {
"version": "2.2.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz",
"integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 0.10" "node": ">=10.13.0"
} }
}, },
"node_modules/is-arrayish": { "node_modules/is-arrayish": {
@ -4540,9 +4548,9 @@
} }
}, },
"node_modules/mini-css-extract-plugin": { "node_modules/mini-css-extract-plugin": {
"version": "2.6.1", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.0.tgz",
"integrity": "sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg==", "integrity": "sha512-auqtVo8KhTScMsba7MbijqZTfibbXiBNlPAQbsVt7enQfcDYLdgG57eGxMqwVU3mfeWANY4F1wUg+rMF+ycZgw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"schema-utils": "^4.0.0" "schema-utils": "^4.0.0"
@ -4893,9 +4901,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.18", "version": "8.4.19",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.19.tgz",
"integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "integrity": "sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -5743,15 +5751,15 @@
} }
}, },
"node_modules/rechoir": { "node_modules/rechoir": {
"version": "0.7.1", "version": "0.8.0",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz",
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"resolve": "^1.9.0" "resolve": "^1.20.0"
}, },
"engines": { "engines": {
"node": ">= 0.10" "node": ">= 10.13.0"
} }
}, },
"node_modules/redent": { "node_modules/redent": {
@ -6300,15 +6308,15 @@
} }
}, },
"node_modules/stylelint": { "node_modules/stylelint": {
"version": "14.14.1", "version": "14.15.0",
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.1.tgz", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.15.0.tgz",
"integrity": "sha512-Jnftu+lSD8cSpcV/+Z2nfgfgFpTIS1FcujezXPngtoIQ6wtwutL22MsNE0dJuMiM1h1790g2qIjAyUZCMrX4sw==", "integrity": "sha512-JOgDAo5QRsqiOZPZO+B9rKJvBm64S0xasbuRPAbPs6/vQDgDCnZLIiw6XcAS6GQKk9k1sBWR6rmH3Mfj8OknKg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@csstools/selector-specificity": "^2.0.2", "@csstools/selector-specificity": "^2.0.2",
"balanced-match": "^2.0.0", "balanced-match": "^2.0.0",
"colord": "^2.9.3", "colord": "^2.9.3",
"cosmiconfig": "^7.0.1", "cosmiconfig": "^7.1.0",
"css-functions-list": "^3.1.0", "css-functions-list": "^3.1.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"fast-glob": "^3.2.12", "fast-glob": "^3.2.12",
@ -6328,7 +6336,7 @@
"micromatch": "^4.0.5", "micromatch": "^4.0.5",
"normalize-path": "^3.0.0", "normalize-path": "^3.0.0",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"postcss": "^8.4.18", "postcss": "^8.4.19",
"postcss-media-query-parser": "^0.2.3", "postcss-media-query-parser": "^0.2.3",
"postcss-resolve-nested-selector": "^0.1.1", "postcss-resolve-nested-selector": "^0.1.1",
"postcss-safe-parser": "^6.0.0", "postcss-safe-parser": "^6.0.0",
@ -6444,6 +6452,22 @@
"integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
"dev": true "dev": true
}, },
"node_modules/stylelint/node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/stylelint/node_modules/resolve-from": { "node_modules/stylelint/node_modules/resolve-from": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@ -6880,9 +6904,9 @@
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
}, },
"node_modules/webpack": { "node_modules/webpack": {
"version": "5.74.0", "version": "5.75.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz",
"integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/eslint-scope": "^3.7.3", "@types/eslint-scope": "^3.7.3",
@ -6927,44 +6951,42 @@
} }
}, },
"node_modules/webpack-cli": { "node_modules/webpack-cli": {
"version": "4.10.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.0.tgz",
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", "integrity": "sha512-AACDTo20yG+xn6HPW5xjbn2Be4KUzQPebWXsDMHwPPyKh9OnTOJgZN2Nc+g/FZKV3ObRTYsGvibAvc+5jAUrVA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.2.0", "@webpack-cli/configtest": "^2.0.0",
"@webpack-cli/info": "^1.5.0", "@webpack-cli/info": "^2.0.0",
"@webpack-cli/serve": "^1.7.0", "@webpack-cli/serve": "^2.0.0",
"colorette": "^2.0.14", "colorette": "^2.0.14",
"commander": "^7.0.0", "commander": "^9.4.1",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"envinfo": "^7.7.3",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2", "import-local": "^3.0.2",
"interpret": "^2.2.0", "interpret": "^3.1.1",
"rechoir": "^0.7.0", "rechoir": "^0.8.0",
"webpack-merge": "^5.7.3" "webpack-merge": "^5.7.3"
}, },
"bin": { "bin": {
"webpack-cli": "bin/cli.js" "webpack-cli": "bin/cli.js"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=14.15.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/webpack" "url": "https://opencollective.com/webpack"
}, },
"peerDependencies": { "peerDependencies": {
"webpack": "4.x.x || 5.x.x" "webpack": "5.x.x"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"@webpack-cli/generators": { "@webpack-cli/generators": {
"optional": true "optional": true
}, },
"@webpack-cli/migrate": {
"optional": true
},
"webpack-bundle-analyzer": { "webpack-bundle-analyzer": {
"optional": true "optional": true
}, },
@ -6973,6 +6995,15 @@
} }
} }
}, },
"node_modules/webpack-cli/node_modules/commander": {
"version": "9.4.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz",
"integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==",
"dev": true,
"engines": {
"node": "^12.20.0 || >=14"
}
},
"node_modules/webpack-merge": { "node_modules/webpack-merge": {
"version": "5.8.0", "version": "5.8.0",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz",
@ -8637,25 +8668,23 @@
} }
}, },
"@webpack-cli/configtest": { "@webpack-cli/configtest": {
"version": "1.2.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.0.tgz",
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", "integrity": "sha512-war4OU8NGjBqU3DP3bx6ciODXIh7dSXcpQq+P4K2Tqyd8L5OjZ7COx9QXx/QdCIwL2qoX09Wr4Cwf7uS4qdEng==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
"@webpack-cli/info": { "@webpack-cli/info": {
"version": "1.5.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.0.tgz",
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", "integrity": "sha512-NNxDgbo4VOkNhOlTgY0Elhz3vKpOJq4/PKeKg7r8cmYM+GQA9vDofLYyup8jS6EpUvhNmR30cHTCEIyvXpskwA==",
"dev": true, "dev": true,
"requires": { "requires": {}
"envinfo": "^7.7.3"
}
}, },
"@webpack-cli/serve": { "@webpack-cli/serve": {
"version": "1.7.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.0.tgz",
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", "integrity": "sha512-Rumq5mHvGXamnOh3O8yLk1sjx8dB30qF1OeR6VC00DIR6SLJ4bwwUGKC4pE7qBFoQyyh0H9sAg3fikYgAqVR0w==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
@ -9122,25 +9151,25 @@
"dev": true "dev": true
}, },
"css-loader": { "css-loader": {
"version": "6.7.1", "version": "6.7.2",
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.1.tgz", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.2.tgz",
"integrity": "sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw==", "integrity": "sha512-oqGbbVcBJkm8QwmnNzrFrWTnudnRZC+1eXikLJl0n4ljcfotgRifpg2a1lKy8jTrc4/d9A/ap1GFq1jDKG7J+Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"icss-utils": "^5.1.0", "icss-utils": "^5.1.0",
"postcss": "^8.4.7", "postcss": "^8.4.18",
"postcss-modules-extract-imports": "^3.0.0", "postcss-modules-extract-imports": "^3.0.0",
"postcss-modules-local-by-default": "^4.0.0", "postcss-modules-local-by-default": "^4.0.0",
"postcss-modules-scope": "^3.0.0", "postcss-modules-scope": "^3.0.0",
"postcss-modules-values": "^4.0.0", "postcss-modules-values": "^4.0.0",
"postcss-value-parser": "^4.2.0", "postcss-value-parser": "^4.2.0",
"semver": "^7.3.5" "semver": "^7.3.8"
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "7.3.7", "version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@ -10073,9 +10102,9 @@
"dev": true "dev": true
}, },
"interpret": { "interpret": {
"version": "2.2.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz",
"integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==",
"dev": true "dev": true
}, },
"is-arrayish": { "is-arrayish": {
@ -10410,9 +10439,9 @@
"dev": true "dev": true
}, },
"mini-css-extract-plugin": { "mini-css-extract-plugin": {
"version": "2.6.1", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.0.tgz",
"integrity": "sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg==", "integrity": "sha512-auqtVo8KhTScMsba7MbijqZTfibbXiBNlPAQbsVt7enQfcDYLdgG57eGxMqwVU3mfeWANY4F1wUg+rMF+ycZgw==",
"dev": true, "dev": true,
"requires": { "requires": {
"schema-utils": "^4.0.0" "schema-utils": "^4.0.0"
@ -10660,9 +10689,9 @@
} }
}, },
"postcss": { "postcss": {
"version": "8.4.18", "version": "8.4.19",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.19.tgz",
"integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "integrity": "sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==",
"dev": true, "dev": true,
"requires": { "requires": {
"nanoid": "^3.3.4", "nanoid": "^3.3.4",
@ -11226,12 +11255,12 @@
} }
}, },
"rechoir": { "rechoir": {
"version": "0.7.1", "version": "0.8.0",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz",
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"resolve": "^1.9.0" "resolve": "^1.20.0"
} }
}, },
"redent": { "redent": {
@ -11641,15 +11670,15 @@
} }
}, },
"stylelint": { "stylelint": {
"version": "14.14.1", "version": "14.15.0",
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.1.tgz", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.15.0.tgz",
"integrity": "sha512-Jnftu+lSD8cSpcV/+Z2nfgfgFpTIS1FcujezXPngtoIQ6wtwutL22MsNE0dJuMiM1h1790g2qIjAyUZCMrX4sw==", "integrity": "sha512-JOgDAo5QRsqiOZPZO+B9rKJvBm64S0xasbuRPAbPs6/vQDgDCnZLIiw6XcAS6GQKk9k1sBWR6rmH3Mfj8OknKg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@csstools/selector-specificity": "^2.0.2", "@csstools/selector-specificity": "^2.0.2",
"balanced-match": "^2.0.0", "balanced-match": "^2.0.0",
"colord": "^2.9.3", "colord": "^2.9.3",
"cosmiconfig": "^7.0.1", "cosmiconfig": "^7.1.0",
"css-functions-list": "^3.1.0", "css-functions-list": "^3.1.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"fast-glob": "^3.2.12", "fast-glob": "^3.2.12",
@ -11669,7 +11698,7 @@
"micromatch": "^4.0.5", "micromatch": "^4.0.5",
"normalize-path": "^3.0.0", "normalize-path": "^3.0.0",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"postcss": "^8.4.18", "postcss": "^8.4.19",
"postcss-media-query-parser": "^0.2.3", "postcss-media-query-parser": "^0.2.3",
"postcss-resolve-nested-selector": "^0.1.1", "postcss-resolve-nested-selector": "^0.1.1",
"postcss-safe-parser": "^6.0.0", "postcss-safe-parser": "^6.0.0",
@ -11692,6 +11721,19 @@
"integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
"dev": true "dev": true
}, },
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
},
"resolve-from": { "resolve-from": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@ -12072,9 +12114,9 @@
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
}, },
"webpack": { "webpack": {
"version": "5.74.0", "version": "5.75.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz",
"integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-scope": "^3.7.3", "@types/eslint-scope": "^3.7.3",
@ -12133,23 +12175,32 @@
} }
}, },
"webpack-cli": { "webpack-cli": {
"version": "4.10.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.0.tgz",
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", "integrity": "sha512-AACDTo20yG+xn6HPW5xjbn2Be4KUzQPebWXsDMHwPPyKh9OnTOJgZN2Nc+g/FZKV3ObRTYsGvibAvc+5jAUrVA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.2.0", "@webpack-cli/configtest": "^2.0.0",
"@webpack-cli/info": "^1.5.0", "@webpack-cli/info": "^2.0.0",
"@webpack-cli/serve": "^1.7.0", "@webpack-cli/serve": "^2.0.0",
"colorette": "^2.0.14", "colorette": "^2.0.14",
"commander": "^7.0.0", "commander": "^9.4.1",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"envinfo": "^7.7.3",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2", "import-local": "^3.0.2",
"interpret": "^2.2.0", "interpret": "^3.1.1",
"rechoir": "^0.7.0", "rechoir": "^0.8.0",
"webpack-merge": "^5.7.3" "webpack-merge": "^5.7.3"
},
"dependencies": {
"commander": {
"version": "9.4.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz",
"integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==",
"dev": true
}
} }
}, },
"webpack-merge": { "webpack-merge": {

View file

@ -15,21 +15,21 @@
"babel-loader": "^9.1.0", "babel-loader": "^9.1.0",
"browserlist": "^1.0.1", "browserlist": "^1.0.1",
"compression-webpack-plugin": "^10.0.0", "compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.2.0", "css-loader": "^6.7.2",
"cssnano": "^5.1.14", "cssnano": "^5.1.14",
"eslint": "^8.27.0", "eslint": "^8.27.0",
"eslint-webpack-plugin": "^3.2.0", "eslint-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^2.6.1", "mini-css-extract-plugin": "^2.7.0",
"postcss": "^8.4.18", "postcss": "^8.4.19",
"postcss-combine-duplicated-selectors": "^10.0.2", "postcss-combine-duplicated-selectors": "^10.0.2",
"postcss-combine-media-query": "^1.0.1", "postcss-combine-media-query": "^1.0.1",
"postcss-import": "^15.0.0", "postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1", "postcss-loader": "^7.0.1",
"stylelint": "^14.14.1", "stylelint": "^14.15.0",
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^29.0.0",
"stylelint-webpack-plugin": "^3.1.1", "stylelint-webpack-plugin": "^3.1.1",
"webpack": "^5.74.0", "webpack": "^5.75.0",
"webpack-cli": "^4.10.0" "webpack-cli": "^5.0.0"
}, },
"scripts": { "scripts": {
"compress": "scripts/compress", "compress": "scripts/compress",

View file

@ -84,23 +84,29 @@ class MicropubMediaTest extends TestCase
Queue::fake(); Queue::fake();
Storage::fake('s3'); Storage::fake('s3');
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
$token = $this->getToken();
config(['filesystems.disks.s3.url' => 'https://s3.example.com']);
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
[ [
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true), 'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
], ],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $location = $response->headers->get('Location');
$this->assertStringStartsWith('https://s3.example.com/', $location);
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
$lastUploadResponse = $this->get( $lastUploadResponse = $this->get(
'/api/media?q=last', '/api/media?q=last',
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$lastUploadResponse->assertJson(['url' => $response->getData()->location]); $lastUploadResponse->assertJson(['url' => $response->headers->get('Location')]);
// now remove file // now remove file
unlink(storage_path('app/') . $filename); unlink(storage_path('app/') . $filename);
@ -112,24 +118,25 @@ class MicropubMediaTest extends TestCase
Queue::fake(); Queue::fake();
Storage::fake('s3'); Storage::fake('s3');
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
$token = $this->getToken();
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
[ [
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true), 'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
], ],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
$sourceUploadResponse = $this->get( $sourceUploadResponse = $this->get(
'/api/media?q=source', '/api/media?q=source',
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$sourceUploadResponse->assertJson(['items' => [[ $sourceUploadResponse->assertJson(['items' => [[
'url' => $response->getData()->location, 'url' => $response->headers->get('Location'),
]]]); ]]]);
// now remove file // now remove file
@ -142,24 +149,25 @@ class MicropubMediaTest extends TestCase
Queue::fake(); Queue::fake();
Storage::fake('s3'); Storage::fake('s3');
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
$token = $this->getToken();
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
[ [
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true), 'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
], ],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
$sourceUploadResponse = $this->get( $sourceUploadResponse = $this->get(
'/api/media?q=source&limit=1', '/api/media?q=source&limit=1',
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $token]
); );
$sourceUploadResponse->assertJson(['items' => [[ $sourceUploadResponse->assertJson(['items' => [[
'url' => $response->getData()->location, 'url' => $response->headers->get('Location'),
]]]); ]]]);
// And given our limit of 1 there should only be one result // And given our limit of 1 there should only be one result
$this->assertCount(1, json_decode($sourceUploadResponse->getContent(), true)['items']); $this->assertCount(1, json_decode($sourceUploadResponse->getContent(), true)['items']);
@ -257,7 +265,7 @@ class MicropubMediaTest extends TestCase
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
Queue::assertPushed(ProcessMedia::class); Queue::assertPushed(ProcessMedia::class);
Storage::disk('local')->assertExists($filename); Storage::disk('local')->assertExists($filename);
@ -280,7 +288,7 @@ class MicropubMediaTest extends TestCase
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
Queue::assertPushed(ProcessMedia::class); Queue::assertPushed(ProcessMedia::class);
Storage::disk('local')->assertExists($filename); Storage::disk('local')->assertExists($filename);
@ -303,7 +311,7 @@ class MicropubMediaTest extends TestCase
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
Queue::assertPushed(ProcessMedia::class); Queue::assertPushed(ProcessMedia::class);
Storage::disk('local')->assertExists($filename); Storage::disk('local')->assertExists($filename);
@ -325,7 +333,7 @@ class MicropubMediaTest extends TestCase
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
); );
$path = parse_url($response->getData()->location, PHP_URL_PATH); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
$filename = substr($path, 7); $filename = substr($path, 7);
Queue::assertPushed(ProcessMedia::class); Queue::assertPushed(ProcessMedia::class);
Storage::disk('local')->assertExists($filename); Storage::disk('local')->assertExists($filename);