Skip to content
Advertisement

Tag: laravel

how can I print user_Id from this array format?

I am using Laravel 8. I want to fetch single data and use it. Answer Please don’t use print_r to dump your records. kindly use dd() or dump(). So you have a clear idea about collections. So as of now, you fetch as if you have multiple models you can use loops.

Laravel – Correct way to catch cURL exceception

I am building a simple REST API package using cURL and would like to catch an error and then return a view. I am able to throw an error if I dd($e) but if I try and return a view it just continues with the code after the catch function. Shouldn’t PHP kill the process and just go to the

Laravel DOMDocument : failed to open stream: Permission denied

I’m trying to generate xml file in Laravel, I use DOMdocument but I got this error message when I try to save the file : Code in blade file : I know it’s something with permission but i’m not sure where to change the permission and for what. Thank you for help in advance. Answer Seems you need to provide

laravel – how to add prefix in all url without affecting route existing

i have url like this mysite.com/company, i want add prefix to url to become mysite.com/home/company. I’ve tried to add a route group, but that requires me to update all existing routes. can i add a prefix in all url without affecting the existing route ? i used laravel 5.6 Answer I have created a sandbox so that you can view

justify content space between not working in dompdf

I have such a report that generated by DOMPDF and created with Laravel. I want to display text, one in text-align: left, and another one in text-align: right (both in a same line). But it’s not working in my code. Anybody would to help me with this issue please? I’ve been looking for this but still couldn’t find the solution.

Concatenate php in laravel

I am not very good at php. I have a function to check for an empty field and the correctness of email There is also a code in php.blade in which you need to insert this check How to do it correctly? I just pasted into @php and it doesn’t work Answer Here is a solution where you dont show

How to update a column by joining four tables in laravel

I have four tables default_products_product_mileage_gap default_products_mileage_gap default_products_products default_products_products_mileage_gaps I am trying to update a column number_of_products_sold to some value using laravel What I have tried is: Here number_of_products_sold is not updating. How to update the column Answer Why you want to add four table together. here is an example to add or update multiple table from by controller.

Advertisement