Skip to content

Commit

Permalink
change templates to auth policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sline-X committed May 4, 2023
1 parent 5752329 commit 51655a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@section('title', 'Мои объявления')

@section('main')
<h2>Добро пожаловать, {{ Auth::user()->name }}!</h2>
<p class="text-right"><a href="{{ route('bb.add') }}">Добавить отбъявление</a></p>
@if (count($bbs) > 0)
<table class="table table-striped">
Expand Down
4 changes: 4 additions & 0 deletions resources/views/layouts/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
<nav class="navbar navbar-light bg-light">
<a href="{{ route('index') }}"
class="navbar-brand mr-auto ">Главная</a>
@guest
<a href="{{ route('register') }}"
class="nav-item nav-link ">Регистрация</a>
<a href="{{ route('login') }}"
class="nav-item nav-link">Вход</a>
@endguest
@auth
<a href="{{ route('home') }}"
class="nav-item nav-link">Мои Объявления</a>
<form action="{{ route('logout') }}" method="POST"
Expand All @@ -26,6 +29,7 @@ class="form-inline">
<input type="submit" class="btn btn-danger"
value="Выход">
</form>
@endauth
</nav>
<h1 class="my-3 text-center">Объявления</h1>
@yield('main')
Expand Down

0 comments on commit 51655a4

Please sign in to comment.