Name of images encrypted in laravel 8

Viewed 60

I am in doubt I am studying laravel 8 and when I move the image file to the public folder it saves with the encrypted name and not with the original name if anyone can help me thank you

//Controller

public function store(Request $request)
{

    $method = $request->method();
    if ($request->isMethod('post')) {


        $validatedImage = $request->validate([
            'thumb' => 'required|image|mimes:jpg,png,jpeg,gif,svg|max:2048',
        ]);
            
        $thumb = $request->file('thumb')->store('public/uploads/blog/thumb');

        Posts::create([
            'thumb' => $request->file('thumb')->getClientOriginalName(),
            'name' => $request->input('name'),
            'description' => $request->input('description')
        ]);
        return redirect('/blog/posts')->with('success', 'Post Cadastrado');
    }
}

VFoqu7AfAwTYGBMlWrrVBuf7rnC5OeQnxwt8dtAI.png

0 Answers
Related