Basic routes and BeerListController methods
This commit is contained in:
@@ -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
|
||||
20
resources/views/list/create.blade.php
Normal file
20
resources/views/list/create.blade.php
Normal 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
|
||||
6
resources/views/list/show.blade.php
Normal file
6
resources/views/list/show.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
{{ $list->title }}
|
||||
|
||||
@endsection
|
||||
15
resources/views/profile.blade.php
Normal file
15
resources/views/profile.blade.php
Normal 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
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user