+5
-1
@@ -19,7 +19,7 @@ use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
$app = Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
api: __DIR__.'/../routes/api.php',
|
||||
@@ -106,3 +106,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
return $response;
|
||||
});
|
||||
})->create();
|
||||
|
||||
(require __DIR__.'/storage.php')($app->basePath(), $app->storagePath());
|
||||
|
||||
return $app;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
// Runtime directories are not distributed with application data. Prepare them
|
||||
// before Laravel loads view configuration (which resolves the compiled path).
|
||||
return static function (string $basePath, string $storagePath): void {
|
||||
foreach (['app/private', 'app/public', 'framework/cache/data', 'framework/sessions', 'framework/views', 'logs'] as $directory) {
|
||||
$path = $storagePath.'/'.$directory;
|
||||
if (! is_dir($path) && ! @mkdir($path, 0775, true) && ! is_dir($path)) {
|
||||
throw new RuntimeException('Cannot create Laravel runtime directory: '.$path);
|
||||
}
|
||||
}
|
||||
|
||||
$cachePath = $basePath.'/bootstrap/cache';
|
||||
if (! is_dir($cachePath) && ! @mkdir($cachePath, 0775, true) && ! is_dir($cachePath)) {
|
||||
throw new RuntimeException('Cannot create Laravel bootstrap cache: '.$cachePath);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user