dimanche 18 septembre 2016

Trying to get property of non-object when posting data

I've seen this error a few times while handling data, however now I'm just trying to post data to my controller and I don't understand why I see this error as there aren't any objects?

Trying to get property of non-object

The view -

<form role="form" class="wizard" type="POST" action="">
  
    <input type="text" name="seo_score" value="" placeholder="SEO Score e.g. 82" class="col-md-3" maxlength="2"/>

    <div class="col-md-4 col-md-offset-8 submit">
      <hr>
      <button type="submit" class="primary-btn">Submit</button>
    </div>
</form>

The route -

Route::post('/admin/overview/post', [
    'uses' => '\App\Http\Controllers\AdminController@postData',
    'as' => 'data.post',
    'middleware' => ['auth', 'admin'],
]);

The controller -

public function postData(Request $request) {
   return redirect()->back();
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire