I have create form for user to comment in my post but I want need check Auth has Login before submit the form. How can i do that ?
For me I have use middleware to protect it, But If use not login it redirect to Login Form when user has been login it is not redirect back to posts route/show-posts/{post}
,It redirect to back to route/comments
. How can i solve this ?
URL Show Single Post
Route::get( '/show-post/{post}', 'HomePageController@single_show')
->name('home.post.show' );
URL form Comments form
Route::resource('/comments', 'CommentsController');
CommentsController
public function __construct() {
$this->middleware( 'auth')->except(['index', 'show']);
}