djay
172
9
Laravel

Redirect problem

Posted 1 year ago by djay

Hi

I have user profile page which is visible to guest users (without login)

I have "Like" button on profile page.

authenticated user can "Like" the profile directly by like button

But for guest users I want to redirect to login page:

@if(Auth::guest())
        <a class="btn btn-info" href="{{ url('login') }}">Login to continue</a>
@else
    <form class="form-inline">
            <input type="hidden" id="userId" value="{{$user->id}}">
            <button class="btn btn-info" id="ajaxLike"><i class="fa fa-thumbs-up" style="font-size:16px"></i>   Like</button>
        </form>

and after login I want it to redirect back to profile page.

But after logging in- it redirects to dashboard and not to profile page

How can I do this???

Thanks in advance

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.