Skip to content
Advertisement

Tag: laravel

Build csv and upload to google drive in php (laravel 5.8)

How do I send a response()->stream() to google drive ? I’m not getting it because this method returns a class and not a file. My question is if I will need to save locally using file_put_contents() so that I can then send it to google drive On google drive my file looks like this: Answer Try this

Laravel – Middleware custom typed Request parameter

I want to use VacancyListRequest to pass through middleware parameters and use its rules to validate them before controller action. I know that middleware acts Pipeline pattern, but does anybody know how to use any custom type except default IlluminateHttpRequest? Middleware Controller Error AppHttpMiddlewareVacancyBeforeVacancyIndexRequestMiddleware::handle(): Argument #1 ($request) must be of type AppHttpRequestsVacancyVacancyListRequest, IlluminateHttpRequest given, Answer You are getting that error

“User is not set” IncompleteDsnException after migrating to Laravel 9

I was using Laravel 8.64, and my emails were working fine both on prod and dev servers. However, after upgrading to 9.0.2, I have an issue with sending emails. Of course, I followed all instructions, but still, I get errors when I try to send an email. User is not set. {“exception”:”[object] (SymfonyComponentMailerExceptionIncompleteDsnException(code: 0): User is not set. After some

Laravel 8 Custom Login With Custom Model

Greetings to all I have a problem with my Laravel 8 code I’m getting “ErrorException Undefined index: password” from vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:159 I use custom model and I set up in config/auth.php to use my Client model not a User model and when I try Auth::attempt($credentials) it’s failed and give me that error here is my code Client.php Model config/auth.php ClientController.php Answer

Laravel, search exact same substring in eloquent query

I have a table like this Teacher Table What I am trying to do is to get the row which contains the subjects 1(or any other number like 7,8 etc.) This is what I have tried in my controller. The problem here is that, I am getting all the rows which contains subjects as ‘1’,e.g. if it is ‘3,11,22’ or

How to visit an array indexed by indexed in php / Laravel?

I got an API response like [“at123@gmail.com”,”adhd5@gmail.com”,”adahsad5@gmail.com”] I got this array in a request variable $request->optional_email I am trying to access data by a loop like below: But it doesn’t work. How can I solve it? Answer As the $request->optional_email is just a list you do not need to use the $key variable in the foreach. Instead you should just

Advertisement