Basic routes and BeerListController methods

This commit is contained in:
2021-09-04 23:54:41 +02:00
parent 1b8e76b183
commit 26dbfeb94a
20 changed files with 146 additions and 64 deletions

View File

@@ -1,23 +0,0 @@
@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">{{ __('Dashboard') }}</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
{{ __('You are logged in!') }}
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,20 @@
@extends('layouts.app')
@section('content')
Add list
<form method="POST" action="{{ route('list.store') }}">
@csrf
<label for="title">
List Name
</label>
<input class="bg-gray-300 border-black border-1" type="text" name="title">
@if ($errors->has('title'))
<span class="text-red-600" role="alert">
<strong>{{ $errors->first('title') }}</strong>
</span>
@endif
<button type="submit">
Add List
</button>
</form>
@endsection

View File

@@ -0,0 +1,6 @@
@extends('layouts.app')
@section('content')
{{ $list->title }}
@endsection

View File

@@ -0,0 +1,15 @@
@extends('layouts.app')
@section('content')
<div class="container">
Profile
</div>
<a href="{{ route('list.create') }}">
Add Beer list
</a>
@foreach (Auth::user()->lists as $list)
<a href="{{ route('list.show', $list->id) }}">
{{ $list->title }}
</a>
@endforeach
@endsection

View File

@@ -25,7 +25,7 @@
@if (Route::has('login'))
<div class="hidden fixed top-0 right-0 px-6 py-4 sm:block">
@auth
<a href="{{ url('/home') }}" class="text-sm text-gray-700 underline">Home</a>
<a href="{{ url('/profile') }}" class="text-sm text-gray-700 underline">Profile</a>
@else
<a href="{{ route('login') }}" class="text-sm text-gray-700 underline">Log in</a>