A
A
Alexander Shvedov2019-07-27 16:06:02
Laravel
Alexander Shvedov, 2019-07-27 16:06:02

Laravel image update?

private function storeImage($page)
    {
        if (request()->has('img')) {
            $page->update([
                'img' => request()->img->store('img', 'public'),
            ]);
        }
    }

Adds a path with 'img/namefiele' to the database how to make it just 'namefile'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question