the choose file button is not responding when trying to upload an image file

  Kiến thức lập trình

i created a project in Laravel 10, with listings table, and everything is running okey, except the
‘Choose file’ button: it’s not responding at all. so I’m not able to load an image for my listing.

i tried to change the image format or extension, but uselessly.
the definition in “listingcontroller” seems to be wright like this:

    `if($request->hasFile('logo')) {
    $formFields['logo'] = $request->file('logo')->store ('logos', 'public');
    }`

i should have a folder created on storage/app/logos now, and the image must be loaded inside it,
but the button not responding at all;
and here is the definition for the creat.blade.php file:

    `<div class="mb-6">
    <label for="logo" class="inline-block text-lg mb-2">
    Company Logo
    </label>
    <input type="file" class="border border-gray-200 rounded p-2 w-full" name="logo" />
    @error('logo')
    <p class="text-red-500 text-xs mt-1">{{$message}}</p>
    @enderror
    </div>`

and i am using the ‘Model::unguard();” method in the AppServiceProvider file.
everything looks okey, can somebody help please?

New contributor

ahmad aali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT