This commit is contained in:
2023-10-15 23:40:34 +03:00
parent 8d3e8373c0
commit 5ebf3311e4
15 changed files with 393 additions and 240 deletions
+14 -4
View File
@@ -11,6 +11,9 @@ use Lucent\Commands\CompileSchemas;
use Lucent\Commands\RebuildThumbnails;
use Lucent\File\FileService;
use Lucent\File\ImageService;
use Lucent\Query\DatabaseGraph\DatabaseGraph;
use Lucent\Query\DatabaseGraph\PgsqlDatabaseGraph;
use Lucent\Query\DatabaseGraph\SqliteDatabaseGraph;
class LucentServiceProvider extends ServiceProvider
{
@@ -27,6 +30,13 @@ class LucentServiceProvider extends ServiceProvider
return new ImageManager(['driver' => 'imagick']);
});
$this->app->bind(DatabaseGraph::class, function () {
return match (config("database.lucent")) {
"sqlite" => new SqliteDatabaseGraph(),
"pgsql" => new PgsqlDatabaseGraph(),
};
});
}
@@ -37,9 +47,9 @@ class LucentServiceProvider extends ServiceProvider
{
$manifestPath = public_path('vendor/lucent/dist/manifest.json');
$manifest = null;
if(file_exists($manifestPath)){
$manifest = json_decode(file_get_contents(public_path('vendor/lucent/dist/manifest.json')),true);
$manifest = null;
if (file_exists($manifestPath)) {
$manifest = json_decode(file_get_contents(public_path('vendor/lucent/dist/manifest.json')), true);
}
@@ -68,7 +78,7 @@ class LucentServiceProvider extends ServiceProvider
]);
$this->publishes([
__DIR__.'/../front/dist' => public_path('vendor/lucent/dist'),
__DIR__ . '/../front/dist' => public_path('vendor/lucent/dist'),
], 'public');
}
}