I'm learning Laravel right now on [Laravel From Scratch 2022 by Traversy Media (Youtube)](https://youtu.be/MYyJ4PuL4pY?t=10424). I want to create a file upload function for new listing form. When I tried to upload, the image was uploaded into the right path in public storage but the path is not in the database, instead the value inserted is 0.

Here is the code for **ListingController.php**

```
// Store Listing Data
    public function store(Request $request) {
        $formFields = $request->validate([
            'title' => 'required',
            'company' => ['required', Rule::unique('listings','company')],
            'location' => 'required',
            'website' => 'required',
            'email' => ['required', 'email'],
            'tags' => 'required',
            'description' => 'required'
        ]);

        $directory = "logos";

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

        Listing::create($formFields); 

        return redirect('/')->with('message', 'Listing created successfully!');   
    }

```

Here is the screenshot of image that I successfully uploaded but the value in database is 0.

[Screenshot of Laravel storage/app/public/logos directory](https://i.stack.imgur.com/8NaSG.png)

[Screenshot of MySQL database, column logo is used to store image path](https://i.stack.imgur.com/UHvsw.png)

Thank you for your help!