This is my query in my controller public function show($id) { $Days = DB::table(‘payroll_monthly_attn_project’)->where(‘payroll_monthly_id’,$id)->where(‘assign’,’PAINTING’) …
Tag: laravel
converting an object to an array in laravel
I’m trying to compare two arrays and use the difference of them to remove data from another array but as I use the resulting array to do a array_diff_key using an array_flip it returns; array_diff_key(): Expected parameter 1 to be an array, object given this is the code and I’ve tried converting t…
Return JSON details of failed validation with Laravel 8
I’m creating an endpoint to store an Office with two fields: name, address. When validation fails laravel returns status 200 and a welcome page. It should return 4xx and error details with JSON, shouldn’t it? I tried to catch an exception (ValidationError) but I don’t get the error details. …
how to store 2 variable value in db withh in laravel?
i am trying to store 2 variable value into a single variable in laravel but fail eg Answer
How to access assets from resources sub folder in Laravel?
This is the javascript source in blade file. OR Both asset and URL::to doesn’t work. The actual file path is: resources -> views -> template -> js error shows 404 not found on local xampp server. its working fine in production. project is copy of production code. I would appreciate for your kin…
“The Response callback must not be null” when trying to send a PDF file download in Laravel 7
In my Laravel 7 application, I have a route where a PDF is dynamically generated, and I want the browser to treat it as a file download. In writing this, I found a number of docs and questions about Laravel serving a file download using a file saved on the filesystem, but in my case, I don’t want to sto…
Laravel problem with data array from database
I cant figure out how assign variables in controller from array with database datas. this line: dd($user) return this : how can assign variables from array ? Answer You can use extract to extract array keys as PHP variables. Demo: https://3v4l.org/1IRRF
How to make URL from Laravel routes
I’ve got Laravel backend and I’m trying to make iOS to it, but there is no documentation. It is my first time with Laravel, so confused with the routes and middlewares. How do I compose URL from code …
Add a line break automatically after comma in JSON file?
I have a JSON file automatically generated from my PHP laravel backend, it’s just an array converted to JSON format, problem is I’d like to have a the JSON file row by row instead of this ugly mess of …
Why do host file entries ending in .local result in slow content download?
I just fixed a problem but do not exactly understand why the solution works. Setting: Windows 10 Laravel 7.0 PHP built in server (via php artisan serve –port=80) Hosts file with entry 127.0.0.1 …