@php $isOwner = Auth::id() === $workout->user_id; $canManage = $isOwner || (Auth::check() && $workout->assigned_by_trainer_id === Auth::id()); @endphp
← Back

{{ $workout->title }}

@auth @php $isFav = auth()->user()->hasFavoritedWorkout($workout); @endphp
@csrf
@endauth
@if($workout->assignedByTrainer) Assigned by {{ $workout->assignedByTrainer->name }} @endif @if(!$isOwner && $workout->is_public) Public workout by {{ $workout->user->name }} @endif

@if($workout->estimated_minutes) ~ {{ $workout->estimated_minutes }} min · @endif {{ $workout->items->count() }} exercises

@if($isOwner)
@csrf
@csrf
@csrf @method('DELETE')
@elseif(Auth::check() && $workout->is_public)
@csrf
@endif
@if(session('status'))
{{ session('status') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif

Exercises

@if($workout->items->count() === 0)
No exercises yet. Add your first one on the right.
@else
    @foreach($workout->items as $item)
  • #{{ $item->position }}
    {{ $item->exercise->display_name }}
    @if($item->sets) {{ $item->sets }} sets @endif @if($item->reps) · {{ $item->reps }} reps @endif @if($item->weight) · {{ $item->weight }} kg @endif @if($item->rest_seconds) · {{ $item->rest_seconds }}s rest @endif
    @if($item->notes)
    {{ $item->notes }}
    @endif
    @if($canManage)
    @csrf @method('DELETE')
    @endif
    @if($canManage)
    Edit
    @csrf @method('PATCH')
    @endif
  • @endforeach
@endif
@if($canManage)

Add Exercise

@csrf

No exercises found.

@endif
@push('scripts') @endpush