jeudi 26 octobre 2017

La-ravel : Error- call to undefined method for Auth?

Getting error : Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Call to undefined method Illuminate\Auth\AuthManager::user()

Code in ImageGalleryController

{
        $this->validate($request, [
            'title' => 'required',
            'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
            ]);



     $input['image'] = time().'.'.$request->image->getClientOriginalExtension();
        $request->image->move(public_path('images'), $input['image']);

        $input['title'] = $request->title;
        $input['uid'] = Auth()::user()->id;
        ImageGallery::create($input);

        return back()
        ->with('success','Image Uploaded successfully.');
    }

    /**
     * Remove Image function
     *
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        ImageGallery::find($id)->delete();
        return back()



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

Aucun commentaire:

Enregistrer un commentaire