Skip to content
Advertisement

Tag: laravel-5

Access File Uploaded Attributes in Laravel 5

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.

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

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

Advertisement