mardi 25 août 2020

Laravel nova File Field | How can i get resource id before storing file

I want to store a file with resource id + extension i.e 1.csv,2.csv,3.txt,4.jpeg.

I am using laravel nova File Field to upload file in s3 is there any way I can get the id of that row before storing in db?

below is the code I am using to uploading files.

File::make('path')
    ->disk(config('filesystems.default'))
    ->rules('required','mimes:csv,txt')
    ->storeAs(function (Request $request) {
        return $request->path->getClientExtension();
    })
   ->path('csv'),


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire