set config variables for env variables

This commit is contained in:
2026-02-12 18:07:23 +01:00
parent d3d7292b80
commit 7768e7a9e3
6 changed files with 26 additions and 15 deletions
+2 -2
View File
@@ -13,10 +13,10 @@ class SearchController extends Controller
public function __construct() public function __construct()
{ {
$this->client = new Client([ $this->client = new Client([
'api_key' => env('TYPESENSE_API_KEY'), 'api_key' => config('typesense_api_key'),
'nodes' => [ 'nodes' => [
[ [
'host' => env('TYPESENSE_CONNECTION'), 'host' => config('typesense_connection'),
'port' => '8108', 'port' => '8108',
'protocol' => 'http', 'protocol' => 'http',
], ],
+2 -2
View File
@@ -14,10 +14,10 @@ class TypesenseService
public function __construct() public function __construct()
{ {
$this->client = new Client([ $this->client = new Client([
'api_key' => env('TYPESENSE_API_KEY'), 'api_key' => config('typesense_api_key'),
'nodes' => [ 'nodes' => [
[ [
'host' => env('TYPESENSE_CONNECTION'), 'host' => config('typesense_connection'),
'port' => '8108', 'port' => '8108',
'protocol' => 'http', 'protocol' => 'http',
], ],
+11
View File
@@ -123,4 +123,15 @@ return [
'store' => env('APP_MAINTENANCE_STORE', 'database'), 'store' => env('APP_MAINTENANCE_STORE', 'database'),
], ],
'typesense_api_key' => env('TYPESENSE_API_KEY'),
'typesense_connection' => env('TYPESENSE_CONNECTION'),
'dev' => env('DEV'),
'admin_name' => env('ADMIN_NAME') ?:'admin',
'admin_lastname' => env('ADMIN_LASTNAME') ?: 'admin',
'admin_email' => env('ADMIN_MAIL') ?: 'admin@gmail.com',
'admin_password' => env('ADMIN_PASSWORD') ?: '12345678',
'admin_phone' => env('ADMIN_PHONE_NUMBER') ?: '0909090909',
]; ];
+1 -1
View File
@@ -8,7 +8,7 @@ class DatabaseSeeder extends Seeder
{ {
public function run() public function run()
{ {
if (env('DEV') == 1) { if (config('dev') == 1) {
$this->call(DevSeeder::class); $this->call(DevSeeder::class);
} else { } else {
$this->call(ProdSeeder::class); $this->call(ProdSeeder::class);
+5 -5
View File
@@ -18,11 +18,11 @@ class DevSeeder extends Seeder
$typesense = app(TypesenseService::class); $typesense = app(TypesenseService::class);
$admin = User::factory()->create([ $admin = User::factory()->create([
'name' => env('ADMIN_NAME') ?:'admin', 'name' => config('admin_name'),
'lastname' => env('ADMIN_LASTNAME') ?: 'admin', 'lastname' => config('admin_lastname'),
'email' => env('ADMIN_MAIL') ?: 'admin@gmail.com', 'email' => config('admin_email'),
'password' => env('ADMIN_PASSWORD') ?: '12345678', 'password' => config('admin_password'),
'phone' => env('ADMIN_PHONE_NUMBER') ?: '0909090909', 'phone' => config('admin_phone'),
'role' => 1, 'role' => 1,
'validate' => 1 'validate' => 1
]); ]);
+5 -5
View File
@@ -16,11 +16,11 @@ class ProdSeeder extends Seeder
$typesense = app(TypesenseService::class); $typesense = app(TypesenseService::class);
$admin = User::factory()->create([ $admin = User::factory()->create([
'name' => env('ADMIN_NAME') ?:'admin', 'name' => config('admin_name'),
'lastname' => env('ADMIN_LASTNAME') ?: 'admin', 'lastname' => config('admin_lastname'),
'email' => env('ADMIN_MAIL') ?: 'admin@gmail.com', 'email' => config('admin_email'),
'password' => env('ADMIN_PASSWORD') ?: '12345678', 'password' => config('admin_password'),
'phone' => env('ADMIN_PHONE_NUMBER') ?: '0909090909', 'phone' => config('admin_phone'),
'role' => 1, 'role' => 1,
'validate' => 1 'validate' => 1
]); ]);