Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cac0f3
commit 9989439
Showing
6 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Event; | ||
use Illuminate\Http\Request; | ||
|
||
class EventController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$events = auth()->user()->events() | ||
->orderBy('started_at', 'desc') | ||
->get(); | ||
|
||
return view('events', compact('events')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-8"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
Events | ||
</div> | ||
|
||
<div class="card-body"> | ||
<ul class="list-group list-group-flush"> | ||
@forelse ($events as $event) | ||
<li class="list-group-item d-flex justify-content-between align-items-center"> | ||
<div> | ||
<strong>{{ $event->name }}</strong><br> | ||
<span class="text-muted"> | ||
@if ($event->allday) | ||
{{ $event->started_at->format('l jS F Y') }} | ||
(all day) | ||
@else | ||
{{ $event->started_at->format('l jS F Y \a\t H:i') }} | ||
({{ $event->duration }}) | ||
@endif | ||
</span> | ||
</div> | ||
<span | ||
class="badge badge-pill" | ||
style="background-color: {{ $event->calendar->color }};" | ||
> | ||
{{ $event->calendar->name }} | ||
</span> | ||
</li> | ||
@empty | ||
<li class="list-group-item"> | ||
No events. | ||
</li> | ||
@endforelse | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters