app/Http/Controllers/Admin/StoreController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(StoreRequest $request)
    {
      $dados = $request->all();
      $user = auth()->user();
      if($request->hasFile('logo'))
      {
        $dados['logo'] = $this->uploadImages($request->logo);
      }
     $user->store()->create($dados);
      flash('Dados gravados com sucesso')->success();
      return redirect()->route('admin.stores.index');
    }
public function store ( StoreRequest $ request ) { $ dados = $ request -> all ( ) ; $ user = auth ( ) -> user ( ) ; if ( $ request -> hasFile ( 'logo' ) ) { $ dados [ 'logo' ] = $ this -> uploadImages ( $ request -> logo ) ; } $ user -> store ( ) -> create ( $ dados ) ; flash ( 'Dados gravados com sucesso' ) -> success ( ) ; return redirect ( ) -> route ( 'admin.stores.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .