I upload a file In my controller, I did this I see this I want to pathname: “/private/var/tmp/phpb73hcy”, I’ve tried I just want this /private/var/tmp/phpb73hcy Any hints for me ? Answer Use $this->getPathname(). The Laravel UploadedFile class extends the Symfony UploadedFile class, which extends the Symfony File class, which extends the PHP SplFileInfo class. The latter has the getPathname() method.
Tag: laravel-5
DB:Raw not working for date format in postgres
I have the well executed postgres query.I have tried to convert this in laravel but query not executed select id, month, meeting_start_date, call_start_date from mgl_report_targets …
Laravel Middleware not executing functions
I have this Locale middleware which sets language based from settings on DB public function handle($request, Closure $next) { $HQ = Branch::where(‘is_hq’, 1)->where(‘is_active’, 1)-&…
Directory issue in laravel
As I am leaning laravel I am facing directory issues. I have made a navbar in which a create option is given to access the create file which is located in my resources/views/posts/create directory. …
Resource Controller Concept
I am unable to find the issue. It is showing 404|Not Found update.blade.php PostController.php (a resource controller) route: please tell me what is the issue in this. one of the advice I got is to change the name of view file i.e update.blade.php to edit.blade.php. I don’t know how does it help Answer First you should change edit.blade.php instead of
how to stop adding more data in array in foreach loop
i looping 2 array a date and the data i am expecting this result What actually getting Adding old $r to results array How to fix it i am trying to break it but can’t figure it out Answer I have some untested code, as I do not have your data but I think this code below should work, you
How can I display my products from the cart?
I am using Melihovv ShoppingCart. I want to display all products inside cart but I couldn’t. It shows the page but the products are not displaying. Here is my code And here is my view: Answer to display the content of the cart, I think you should use
Laravel I added morphmany SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘staff.staff_id’ in ‘field list’
I store the data correctly but when I try to get a data in edit function it shows me this error SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘staff.staff_id’ in ‘field list’ (SQL: select users.*, staff.staff_id as pivot_staff_id, staff.user_id as pivot_user_id, staff.staff_type as pivot_staff_type, staff.role as pivot_role, staff.created_at as pivot_created_at, staff.updated_at as pivot_updated_at from users inner join staff on users.id
How to send message to selected user with their name laravel
I’m trying to send a message to selected users with their names. So let’s say I have two users Ethan and Calvin then the message should start like User1:(Hi, Ethan), User2:(Hi, Calvin). So far the message is like (Hi, Ethan,Calvin) for every user. How can I fix this? Blade Controller Answer It looks like it’s a problem with names and
Store product multiple colors to the database Laravel
I have a product table which has price, name, stock etc. and color_products table which has color_id, product_id. I want to store a product to the database with selected colors so far I’m getting an error Invalid argument supplied for foreach(). How can I fix this? Controller Blade file Answer try to rename your select field to be something like