Skip to content

Commit

Permalink
Merge pull request #63 from mochammad-fachorrozi/main
Browse files Browse the repository at this point in the history
update component liveware playgrounds and codingcourse
  • Loading branch information
janzenfaidiban authored Jun 10, 2024
2 parents 4cf5d28 + 3618bde commit 35f1468
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
9 changes: 2 additions & 7 deletions app/Livewire/Guest/CodingCourses/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@ class Record extends Component
{
use WithPagination;

// public $CodingCourses;

public function render(): View
{
$CodingCourses = CodingCourses::paginate(10);
// $CodingCourses = CodingCourses::get();

// dd($CodingCourses);
$CodingCourses = CodingCourses::latest()->paginate(6);

return view('livewire.guest.CodingCourses.record',
return view('livewire.guest.codingcourses.record',
[
'CodingCourses' => $CodingCourses
]
Expand Down
5 changes: 3 additions & 2 deletions app/Livewire/Guest/Playgrounds/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
class Record extends Component
{
use WithPagination;


public function render()
{
$playgrounds = Playgrounds::latest()->paginate(6);

return view('livewire.guest.playgrounds.record', [
'playgrounds' => Playgrounds::latest()->paginate(6)
'playgrounds' => $playgrounds
])->layout('layouts.guest');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ class="w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm
<!-- End Page Content -->



<div class="my-6">
{{ $CodingCourses->links() }}
</div>



Expand Down
43 changes: 26 additions & 17 deletions resources/views/livewire/guest/playgrounds/record.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,38 @@

<p class="text-lg text-gray-800 dark:text-neutral-200">All the playgrounds available:</p>

<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">

@foreach ($playgrounds as $playground)
@if (count($playgrounds) > 0)

<!-- Card -->
<div class="group flex flex-col h-full bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-900 dark:border-neutral-700 dark:shadow-neutral-700/70">
<img src="{{ asset($playground->image) }}" alt="{{ $playground->title }}" class="rounded-t-xl">
<div class="mt-auto flex border-t border-gray-200 divide-x divide-gray-200 dark:border-neutral-700 dark:divide-neutral-700">
<a class="w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-ee-xl bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 rounded-b-xl" href="{{ $playground->repository_url }}" target="_blank">
<i class="fa-brands fa-github"></i> {{ $playground->title }}
</a>
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">

@foreach ($playgrounds as $playground)

<!-- Card -->
<div class="group flex flex-col h-full bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-900 dark:border-neutral-700 dark:shadow-neutral-700/70">
<img src="{{ asset($playground->image) }}" alt="{{ $playground->title }}" class="rounded-t-xl">
<div class="mt-auto flex border-t border-gray-200 divide-x divide-gray-200 dark:border-neutral-700 dark:divide-neutral-700">
<a class="w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-ee-xl bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 rounded-b-xl" href="{{ $playground->repository_url }}" target="_blank">
<i class="fa-brands fa-github"></i> {{ $playground->title }}
</a>
</div>
</div>

@endforeach
</div>
<!-- End Content -->

@endforeach
@else
<h1 class="text-xl text-center text-gray-800 font-semibold">Data Not Found</h1>
@endif
</div>

<div class="my-6">
{{ $playgrounds->links() }}
</div>
<!-- End Content -->
</div>
<!-- End Page Content -->

<div class="my-6">
{{ $playgrounds->links() }}
</div>

</div>
</div>
<!-- End Page Content -->

</div>

0 comments on commit 35f1468

Please sign in to comment.