Contents:
You mean change db depend on request?
Where you will save the DB name?
Even before bootstrapping the app?
is there a package in laravel to generate application documentation?
How can I fix it?
What do you mean?
You mean change db depend on request?
Where you will save the DB name?
Even before bootstrapping the app?
is there a package in laravel to generate application documentation?
How can I fix it?
What do you mean?
MasouddAmirii 2020-02-28 19:26:57
Thanks @@kuzmich321
MasouddAmirii 2020-02-28 19:51:07

MasouddAmirii 2020-02-28 19:51:07

MasouddAmirii 2020-02-28 19:51:36
before and after using whereHasπ
skys215 2020-02-28 19:56:51
Nice
Mani 2020-02-28 20:30:51
skys215 2020-02-28 15:33:48
You mean change db depend on request?
Yes changing db according to subdomain
Mani 2020-02-28 20:36:22
Db names will be in the main db corresponding to each domain.
For instance, admin.healthcare.com must use admin DB (main DB) and apollo.healthcare.com must use apollo DB. And all the DBs will be on the same server. Just want to switch between DB changing database name according to the subdomain with one application.
For instance, admin.healthcare.com must use admin DB (main DB) and apollo.healthcare.com must use apollo DB. And all the DBs will be on the same server. Just want to switch between DB changing database name according to the subdomain with one application.
skys215 2020-02-28 20:36:48
Mani 2020-02-28 20:30:51
Yes changing db according to subdomain
I add this code to AppServiceProvider@register()
skys215 2020-02-28 20:37:05
the condition is up to you
Mani 2020-02-28 20:40:42
Yes tht works but the DB_TEST_DATABASE will be dynamic. Where you will save the DB name?
Mani 2020-02-28 20:41:17
I saved it in a table in the main DB
Mani 2020-02-28 20:43:45
And after changing the db post getting name from main Db, when user login with secondary Db app says too many requests.
skys215 2020-02-28 20:43:49
Mani 2020-02-28 20:36:22
Db names will be in the main db corresponding to each domain.
For instance, admin.healthcare.com must use admin DB (main DB) and apollo.healthcare.com must use apollo DB. And all the DBs will be on the same server. Just want to switch between DB changing database name according to the subdomain with one application.
For instance, admin.healthcare.com must use admin DB (main DB) and apollo.healthcare.com must use apollo DB. And all the DBs will be on the same server. Just want to switch between DB changing database name according to the subdomain with one application.
Can’t it just follow some rules?
Mani 2020-02-28 20:44:13
skys215 2020-02-28 20:43:49
Can’t it just follow some rules?
Likewise?
skys215 2020-02-28 20:46:52
Like… admin.example.com uses db_admin
health.example.com use db_health
health.example.com use db_health
Mani 2020-02-28 20:52:51
But how that’s the requirement.
You can test it on your local.
Steps to generate are
1. Add vhost entry in your local pointing to same i p, as i did like
Admin.local and dev.local to 127.0.0.1:80
2. Create two dbs in phpmyadmin
Db_admin and db_dev
4. In database.php in config set main db to db_admin
3. Add new table with corresponding values in db_admin. Like admin (subdomain) to db_admin and dev (subdomain) to db_dev.
4. After adding db changing logic in provider try to login with db_dev and check the result
You can test it on your local.
Steps to generate are
1. Add vhost entry in your local pointing to same i p, as i did like
Admin.local and dev.local to 127.0.0.1:80
2. Create two dbs in phpmyadmin
Db_admin and db_dev
4. In database.php in config set main db to db_admin
3. Add new table with corresponding values in db_admin. Like admin (subdomain) to db_admin and dev (subdomain) to db_dev.
4. After adding db changing logic in provider try to login with db_dev and check the result
skys215 2020-02-28 20:54:58
skys215 2020-02-28 20:36:48
I add this code to AppServiceProvider@register()
You can get the domain here
Mani 2020-02-28 20:55:58
How we don’t have any request object here
Mani 2020-02-28 20:56:12
However we have it in middleware.
Mani 2020-02-28 20:57:21
$request
skys215 2020-02-28 20:59:03
You have php global variable!
skys215 2020-02-28 20:59:16
Try using request() as well
DesolatorMagno 2020-02-28 21:00:15
You have access to request everywhere, you can inject it or just use a helper.
Mani 2020-02-28 21:00:58
DesolatorMagno 2020-02-28 21:00:15
You have access to request everywhere, you can inject it or just use a helper.
Even before bootstrapping the app? As service providers do
Mani 2020-02-28 21:01:28
skys215 2020-02-28 20:59:16
Try using request() as well
Okay let me try taht
DesolatorMagno 2020-02-28 21:01:43
You can always try, worst case scenario it doesn’t work.
Mani 2020-02-28 21:02:21
skys215 2020-02-28 20:59:03
You have php global variable!
Will try this too
Mani 2020-02-28 21:02:25
And update you
Mani 2020-02-28 21:37:27
Hi @skys215 it works thank you for the assistance really appreciated. π
Mani 2020-02-28 21:37:53

Mani 2020-02-28 21:40:40
At last core php worked for us. Now will try to get the database settings dynamically.
2020-02-28 22:02:13
π³οΈβπ I am 35% gay!
Eduardo Oliveira 2020-02-28 23:05:31
is there a package in laravel to generate application documentation?
2020-02-28 23:17:03
hy
Eduardo Oliveira 2020-02-28 23:29:58
Laravel API Documentation Generator
2020-02-29 02:49:00
I have a hyip application and it’s investments doesn’t work which was created at the same minute. How can I fix it?
skys215 2020-02-29 11:25:19
Eduardo Oliveira 2020-02-28 23:05:31
is there a package in laravel to generate application documentation?
Swagger
benson_kb 2020-02-29 11:40:06
laravel paypal error: {“error”:”invalid_client”,”error_description”:”Client Authentication failed”}
2589 2020-02-29 12:43:23
some know how to fix max_connections_per_hour error?
sadeqi125 2020-02-29 13:33:44
hi why i redirec t login after login in laravel
MasouddAmirii 2020-02-29 13:35:45
sadeqi125 2020-02-29 13:33:44
hi why i redirec t login after login in laravel
protected function redirectTo()
{
return ‘/path’;
}
sadeqi125 2020-02-29 13:36:11
MasouddAmirii 2020-02-29 13:35:45
protected function redirectTo()
{
return ‘/path’;
}
{
return ‘/path’;
}
in login controller i write this code
MasouddAmirii 2020-02-29 13:36:25
MasouddAmirii 2020-02-29 13:35:45
protected function redirectTo()
{
return ‘/path’;
}
{
return ‘/path’;
}
return ‘/path’;
MasouddAmirii 2020-02-29 13:36:37
set your custom path to redirect
sadeqi125 2020-02-29 13:41:35
MasouddAmirii 2020-02-29 13:36:25
return ‘/path’;
not work ear
sadeqi125 2020-02-29 13:41:45
i sen you my controller fore you
AlaaDq 2020-02-29 14:50:09
what does
php artisan make:request
used for
php artisan make:request
used for
Roham0010 2020-02-29 14:59:25
AlaaDq 2020-02-29 14:50:09
what does
php artisan make:request
used for
php artisan make:request
used for
https://laravel.com/docs/6.x/validation#creating-form-requests
AlaaDq 2020-02-29 15:00:37
so what the deffernce from http resource
Roham0010 2020-02-29 15:01:28
AlaaDq 2020-02-29 15:00:37
so what the deffernce from http resource
What do you mean? what is http resource!?