Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

spatie/freek.dev

636 stars
3 code files
View spatie/freek.dev on GitHub

app/Http/Controllers/SpeakingController.php

Open in GitHub
use App\Models\Talk;
use App\Models\Video;
 
class SpeakingController
{
public function __invoke()
{
$talks = Talk::orderBy('presented_at', 'desc')
->get()
->groupBy('title');
 
$videos = Video::latest()->get();
 
return view('front.speaking.index', compact('talks', 'videos'));
}
}

resources/views/front/speaking/index.blade.php

Open in GitHub
//
@foreach($talks as $title => $talks)
@include('front.speaking.partials.talk')
@endforeach
</x-app-layout>

resources/views/front/speaking/partials/talk.blade.php

Open in GitHub
<article class="mt-6">
<h2 class="font-semibold leading-tight mb-1">
{{ $title }}
</h2>
<ul class="leading-relaxed">
@foreach ($talks as $talk)
<li class="text-sm text-gray-700">
{{ $talk->location }} on
<time datetime="{{ optional($talk->presented_at)->format(DateTime::ATOM) }}">
{{ $talk->presented_at->format('M jS Y') }}
</time>
@if($talk->video_link)
<a class="underline" href="{{ $talk->video_link }}">
Video</a>
@endif
@if($talk->slides_link)
<a class="underline" href="{{ $talk->slides_link }}">
Slides</a>
@endif
@if($talk->joindin_link)
<a class="underline" href="{{ $talk->joindin_link }}">
Joind.in</a>
@endif
</li>
@endforeach
</ul>
</article>

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.