{{-- ============================================================ resources/views/user/tasks/index.blade.php ============================================================ --}} @extends('layouts.app') @section('title','Tasks') @section('content') {{-- Task Filters --}}
@php $types = ['all'=>'All','video'=>'📹 Video','visit'=>'🌐 Visit','daily'=>'📅 Daily','game'=>'🎮 Game','offer'=>'🎫 Offer','custom'=>'⭐ Custom']; @endphp @foreach($types as $key => $label) {{ $label }} @endforeach
@php $filtered = request('type') ? $tasks->filter(fn($t)=>$t->type===request('type')) : $tasks; @endphp @forelse($filtered as $task)
{{ match($task->type){ 'video'=>'▶','visit'=>'🌐','daily'=>'📅','game'=>'🎮','quiz'=>'🧩','offer'=>'🎫',default=>'⭐' } }}
{{ $task->title }}
{{ Str::limit($task->description,60) }}
{{ ucfirst($task->type) }} {{ $task->completed_today }}/{{ $task->daily_limit }} today
+{{ $task->points }}
pts
@if($task->can_do) @if($task->type === 'visit' && $task->url) @elseif($task->requires_proof) @else @endif @else @endif
@empty
No tasks available right now. Check back later!
@endforelse
{{-- Visit Timer Modal --}} @endsection @push('scripts') @endpush