โ prev | next โ
themanojyadav 2021-12-14 20:15:05
rijisoft 2021-12-14 20:13:49
only $request->post(‘password’) return null
Use this
themanojyadav 2021-12-14 20:15:42
rijisoft 2021-12-14 20:14:41
it’s a team project
I only write apis with laravel
maybe our frontend developer for some reason send paramters on query params
we want to ignore the query params in post api
Then ask your backend developer to write code in controller
themanojyadav 2021-12-14 20:16:06
themanojyadav 2021-12-14 20:06:12
Get all query params in your controller. And check if count of query param is greater than 0 then reject the request.
I guess you want this.
Like this
rijisoft 2021-12-14 20:17:29
themanojyadav 2021-12-14 20:15:42
Then ask your backend developer to write code in controller
I’m backend developer ๐
we wrote more than 100 apis sofar
we can not change all of $request->param to $request->post(‘param’)
and also we use laravel validation method and it’s not useful in this approach
rijisoft 2021-12-14 20:18:33
Anyone has any advice or best practice for this problem ?!!
themanojyadav 2021-12-14 20:18:55
themanojyadav 2021-12-14 20:06:12
Get all query params in your controller. And check if count of query param is greater than 0 then reject the request.
I guess you want this.
Thats why i am telling you. Write this code in controller or best way is write this type of code in middleware
themanojyadav 2021-12-14 20:19:16
Instead replacing the values to empty array. Just reject the request
themanojyadav 2021-12-14 20:19:48
rijisoft 2021-12-14 20:09:20
public function handle($request, Closure $next)
{
if($request->isMethod(‘post’)){
$request->query->replace([]);
}
return $next($request);
}
Reject the request here instead replacing with empty array
rijisoft 2021-12-14 20:19:51
themanojyadav 2021-12-14 20:18:55
Thats why i am telling you. Write this code in controller or best way is write this type of code in middleware
i can not understand why its better to copy and paste bunch of code !
rijisoft 2021-12-14 20:20:16
themanojyadav 2021-12-14 20:19:48
Reject the request here instead replacing with empty array
it’s reject with validation , it’s not a problem
themanojyadav 2021-12-14 20:20:16
rijisoft 2021-12-14 20:19:51
i can not understand why its better to copy and paste bunch of code !
Just write once in middleware
rijisoft 2021-12-14 20:22:03
themanojyadav 2021-12-14 20:20:16
Just write once in middleware
reject request it’s not my problem
reject in middlware or reject by validator , its ok
My question about best practice on ignoring query parameters on post request
and also i want to know why laravel dosen’t igonre them
themanojyadav 2021-12-14 20:24:39
rijisoft 2021-12-14 20:22:03
reject request it’s not my problem
reject in middlware or reject by validator , its ok
My question about best practice on ignoring query parameters on post request
and also i want to know why laravel dosen’t igonre them
Best practice is then what you have already done. Replacing with empty array. It is good.
I guess laravel consider the query params as a complete URL. Because even in post method you can send query param because they are considered as a complete url.
hax_neeraj 2021-12-15 08:28:44
https://www.facebook.com/106240231076407/posts/449069786793448/
Log in or sign up to view –
FacebookSee posts, photos and more on Facebook.
Rao Aadil 2021-12-15 09:21:56
I want to create a private repository on git and share it with other team members, they should be able to clone it push pull commit etc. I dont use git, i have experience with SVN.
Can any one help me with git please
pradeeeps 2021-12-15 09:29:34
Hii i am laravel developer i have 3 year experience i need job for permanent work from home
Contact: 8058810444
2021-12-15 11:24:41
๐๐คน Bangalore Java Jobs for Corporate, 1 yrs experience in springboot , java microservices, springboot security . Immediate joinee .
๐ Salary budget 5L
Ping separately
Kidoci 2021-12-15 12:22:28
Hello dear dev, you are doing well I hope.
I have a question:
Does a web designer also have the mission of coding a website or even changing the design of a site or even making animated icons on the site?
AnonymousArash 2021-12-15 12:26:34
How install laravel collective in laravel 8 ??
Pls ๐
Sahoodsd 2021-12-15 13:03:41
Hey guys i want to add multple text into text field how can add ?
Sahoodsd 2021-12-15 13:04:05
Or any other methods to add multiple text
Sahoodsd 2021-12-15 13:05:16
Currently iam using implode function and and story as a array in database
panda08374 2021-12-15 13:28:57

Hello guys so am having this error and I don’t know why,, anyone kindly help,, I’ll appreciate
HamidRoohani 2021-12-15 13:41:48
panda08374 2021-12-15 13:28:57
Hello guys so am having this error and I don’t know why,, anyone kindly help,, I’ll appreciate
it’s just in your IDE
ignore it
panda08374 2021-12-15 13:49:20
HamidRoohani 2021-12-15 13:41:48
it’s just in your IDE
ignore it
Ooh let me sun it and see
panda08374 2021-12-15 13:52:46
panda08374 2021-12-15 13:49:20
Ooh let me sun it and see
*run
Bhavyakumar Panchotiya 2021-12-15 13:59:05
hey developers .. i hope all are good … which is the best package in laravel for Authentication?
HamidRoohani 2021-12-15 14:06:25
Bhavyakumar Panchotiya 2021-12-15 13:59:05
hey developers .. i hope all are good … which is the best package in laravel for Authentication?
the built-in
Bhavyakumar Panchotiya 2021-12-15 14:13:23
HamidRoohani 2021-12-15 14:06:25
the built-in
yes the built-in !! but which package is best like Laravel Jetstream,
Laravel Breeze etc
HamidRoohani 2021-12-15 14:27:28
Bhavyakumar Panchotiya 2021-12-15 14:13:23
yes the built-in !! but which package is best like Laravel Jetstream,
Laravel Breeze etc
i think it depends on what is your requirements and what do you want
themanojyadav 2021-12-15 14:31:07
HamidRoohani 2021-12-15 14:27:28
i think it depends on what is your requirements and what do you want
Do we make roles in laravel Jetstream?
Guudu ๐ 2021-12-15 14:32:45
How to directly export csv
Guudu ๐ 2021-12-15 14:33:15
Anyone
Bhavyakumar Panchotiya 2021-12-15 14:35:08
HamidRoohani 2021-12-15 14:27:28
i think it depends on what is your requirements and what do you want
ok
panda08374 2021-12-15 15:21:01
HamidRoohani 2021-12-15 13:41:48
it’s just in your IDE
ignore it
It hasn’t worked ๐ช
โ prev | next โ