samedi 27 janvier 2018

Method toArray does not exist

I am trying to convert a request object to an array in laravel using collections... but it keeps telling me toArray method does not exist even after adding the collection name space.

added both of the below namespace individually tested and still not working.

// use Illuminate\Database\Eloquent\Collection as Collection;
 use Illuminate\Support\Collection as Collection;

here is the execution

 $some = $request->file('app')->toArray();
            dd($some);

here is the object i want to change to an array, i wan to fetch the name and validate its extention

to derail a bit, I am doing this because for some reason i can see that the extention is clearly an APK file in the die dump in the picture, but my app wont recorgnize that and validate, keeps telling me that file must be app even after inputting // 'app'=>'required|mimes:application/vnd.android.package-archive'



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2EglmmF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire