Mubashar's avatar

How to give speciel permissions like 777 for public/images

i am working on windows

0 likes
4 replies
Mubashar's avatar

Here is my code $user=$data['name']; $imageName = $user . '_product.' . $user->file('image')->getClientOriginalExtension(); $imageCompletePath = 'public/images/'. $imageName ; $data->file('image')->move( base_path() . '/public/images/', $imageName);

        $user->update(array('image' => $imageCompletePath));

And is gives me this exception maybe because of special permissions FatalErrorException in AuthController.php line 149: Call to a member function file() on string

skliche's avatar
skliche
Best Answer
Level 42

@Mubashar You are assigning a string value to $user:

$user=$data['name'];

Later on you are trying to call a method on that string:

$user->file('image')...

And that is what the error message is trying to tell you.

Please or to participate in this conversation.