Level 75
Have you tried hasFile with the thumbnail?
The dd ends execution.
here is my store function in controller
$request->validate([
'description' => 'required',
'title' => 'required',
'thumbnail' => 'required',
]);
$extra = $request->except(['thumbnail', 'background_image', '_token']);
$extra['type'] = 'comic';
$extra['thumbnail'] = dd($request->file('thumbnail'))->store('thumbnails', 'public');
if($request->hasFile('background_image')) {
$extra['background_image'] = $request->file('background_image')->store('bgs', 'public');
}
Short::create($extra);
return redirect()->route('index');
When i enter information into my form it highlights this line
$extra['thumbnail'] = $request->file('thumbnail')->store('thumbnails', 'public');
And tells me Path cannot be empty, even though i already ran php artisan storage:link. When i added dd it showed me my realPath: false so i tried using storeAs instead instead of store and it showed me the exact same error. Whats wrong with my code? I just want it to be added into my database.
Please or to participate in this conversation.