@if (session('success'))
{{ session('success') }}
@endif
@if (session('error'))
{{ session('error') }}
@endif
{{ $question->title }}
{{ $question->content }}
Asked by {{ $question->user->name }}, {{ $question->created_at->diffForHumans() }}
@auth
@else
@endauth
{{ $question->upvotes }}
@auth
@if(Auth::id() === $question->user_id || Auth::user()->is_admin)
@endif
@endauth
Answers
@foreach($question->answers as $answer)
{{ $answer->content }}
Answered by {{ $answer->user->name }}, {{ $answer->created_at->diffForHumans() }}
@auth
@else
@endauth
{{ $answer->upvotes }}
@endforeach
@auth
@if(Auth::id() !== $question->user_id)
@else
You cannot answer your own question. :))
@endif
@else
Please login to post an answer.
@endauth
@endsection