app/Http/Controllers/DocController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\RedirectResponse
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        if(Auth::check()){
            Auth::user()->docs()->create($request->all());
        }
        return redirect()->to(route('docs.index'));
    }
public function store ( Request $ request ) { if ( Auth :: check ( ) ) { Auth :: user ( ) -> docs ( ) -> create ( $ request -> all ( ) ) ; } return redirect ( ) -> to ( route ( 'docs.index' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//dd($request->all());