lundi 7 novembre 2016

Carbon laravel adding to file name

I have file upload in my controller and need to add carbon to end of my file so I can insert it into database as unique. I'm doing it like this

        $upload->title = Auth::User()->id;
        $current = Carbon::now();
        $file = $request->file('file');
        $file->move(storage_path(). '/', $file->getClientOriginalName());
        $upload->name = $file->getClientOriginalName().$current;
    }

My question is this, when showing it to user how can I remove it so that the user sees only file original name(with php I can do it but I would like to use "laravel way")



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire