Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 21570473

Přidáno uživatelem Adam Mištera před asi 4 roky(ů)

Issue #7788 @2h

[+] Vytvoření registrace a správy uživatelů
[+] Refraktoring

Zobrazit rozdíly:

app/Http/Controllers/ArtefactController.php
8 8

  
9 9
class ArtefactController extends Controller
10 10
{
11
    public function __construct()
12
    {
13
        $this->middleware('auth');
14
    }
15

  
11 16
    /**
12 17
     * Returns view of all artefacts.
13 18
     *
app/Http/Controllers/Auth/ConfirmPasswordController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use App\Providers\RouteServiceProvider;
7
use Illuminate\Foundation\Auth\ConfirmsPasswords;
8

  
9
class ConfirmPasswordController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Confirm Password Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller is responsible for handling password confirmations and
17
    | uses a simple trait to include the behavior. You're free to explore
18
    | this trait and override any functions that require customization.
19
    |
20
    */
21

  
22
    use ConfirmsPasswords;
23

  
24
    /**
25
     * Where to redirect users when the intended url fails.
26
     *
27
     * @var string
28
     */
29
    protected $redirectTo = RouteServiceProvider::HOME;
30

  
31
    /**
32
     * Create a new controller instance.
33
     *
34
     * @return void
35
     */
36
    public function __construct()
37
    {
38
        $this->middleware('auth');
39
    }
40
}
app/Http/Controllers/Auth/ForgotPasswordController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7

  
8
class ForgotPasswordController extends Controller
9
{
10
    /*
11
    |--------------------------------------------------------------------------
12
    | Password Reset Controller
13
    |--------------------------------------------------------------------------
14
    |
15
    | This controller is responsible for handling password reset emails and
16
    | includes a trait which assists in sending these notifications from
17
    | your application to your users. Feel free to explore this trait.
18
    |
19
    */
20

  
21
    use SendsPasswordResetEmails;
22
}
app/Http/Controllers/Auth/LoginController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use App\Providers\RouteServiceProvider;
7
use Illuminate\Foundation\Auth\AuthenticatesUsers;
8

  
9
class LoginController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Login Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller handles authenticating users for the application and
17
    | redirecting them to your home screen. The controller uses a trait
18
    | to conveniently provide its functionality to your applications.
19
    |
20
    */
21

  
22
    use AuthenticatesUsers;
23

  
24
    /**
25
     * Where to redirect users after login.
26
     *
27
     * @var string
28
     */
29
    protected $redirectTo = RouteServiceProvider::HOME;
30

  
31
    /**
32
     * Create a new controller instance.
33
     *
34
     * @return void
35
     */
36
    public function __construct()
37
    {
38
        $this->middleware('guest')->except('logout');
39
    }
40
}
app/Http/Controllers/Auth/RegisterController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use App\Providers\RouteServiceProvider;
7
use App\User;
8
use Illuminate\Foundation\Auth\RegistersUsers;
9
use Illuminate\Support\Facades\Hash;
10
use Illuminate\Support\Facades\Validator;
11

  
12
class RegisterController extends Controller
13
{
14
    /*
15
    |--------------------------------------------------------------------------
16
    | Register Controller
17
    |--------------------------------------------------------------------------
18
    |
19
    | This controller handles the registration of new users as well as their
20
    | validation and creation. By default this controller uses a trait to
21
    | provide this functionality without requiring any additional code.
22
    |
23
    */
24

  
25
    use RegistersUsers;
26

  
27
    /**
28
     * Where to redirect users after registration.
29
     *
30
     * @var string
31
     */
32
    protected $redirectTo = RouteServiceProvider::HOME;
33

  
34
    /**
35
     * Create a new controller instance.
36
     *
37
     * @return void
38
     */
39
    public function __construct()
40
    {
41
        $this->middleware('guest');
42
    }
43

  
44
    /**
45
     * Get a validator for an incoming registration request.
46
     *
47
     * @param  array  $data
48
     * @return \Illuminate\Contracts\Validation\Validator
49
     */
50
    protected function validator(array $data)
51
    {
52
        return Validator::make($data, [
53
            'name' => ['required', 'string', 'max:255'],
54
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
55
            'password' => ['required', 'string', 'min:8', 'confirmed'],
56
        ]);
57
    }
58

  
59
    /**
60
     * Create a new user instance after a valid registration.
61
     *
62
     * @param  array  $data
63
     * @return \App\User
64
     */
65
    protected function create(array $data)
66
    {
67
        //dd($data);
68

  
69
        return User::create([
70
            'name' => $data['name'],
71
            'email' => $data['email'],
72
            'password' => Hash::make($data['password']),
73
        ]);
74
    }
75
}
app/Http/Controllers/Auth/ResetPasswordController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use App\Providers\RouteServiceProvider;
7
use Illuminate\Foundation\Auth\ResetsPasswords;
8

  
9
class ResetPasswordController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Password Reset Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller is responsible for handling password reset requests
17
    | and uses a simple trait to include this behavior. You're free to
18
    | explore this trait and override any methods you wish to tweak.
19
    |
20
    */
21

  
22
    use ResetsPasswords;
23

  
24
    /**
25
     * Where to redirect users after resetting their password.
26
     *
27
     * @var string
28
     */
29
    protected $redirectTo = RouteServiceProvider::HOME;
30
}
app/Http/Controllers/Auth/VerificationController.php
1
<?php
2

  
3
namespace App\Http\Controllers\Auth;
4

  
5
use App\Http\Controllers\Controller;
6
use App\Providers\RouteServiceProvider;
7
use Illuminate\Foundation\Auth\VerifiesEmails;
8

  
9
class VerificationController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Email Verification Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller is responsible for handling email verification for any
17
    | user that recently registered with the application. Emails may also
18
    | be re-sent if the user didn't receive the original email message.
19
    |
20
    */
21

  
22
    use VerifiesEmails;
23

  
24
    /**
25
     * Where to redirect users after verification.
26
     *
27
     * @var string
28
     */
29
    protected $redirectTo = RouteServiceProvider::HOME;
30

  
31
    /**
32
     * Create a new controller instance.
33
     *
34
     * @return void
35
     */
36
    public function __construct()
37
    {
38
        $this->middleware('auth');
39
        $this->middleware('signed')->only('verify');
40
        $this->middleware('throttle:6,1')->only('verify', 'resend');
41
    }
42
}
app/Http/Controllers/DetailsController.php
9 9

  
10 10
class DetailsController extends Controller
11 11
{
12
    public function __construct()
13
    {
14
        $this->middleware('auth');
15
    }
16

  
12 17
    /**
13 18
     * Display a listing of the resource.
14 19
     *
app/Http/Controllers/HomeController.php
1
<?php
2

  
3
namespace App\Http\Controllers;
4

  
5
use Illuminate\Http\Request;
6

  
7
/*
8
 * Automatically generated by Laravel auth. Leaved in case of future usage.
9
 */
10
class HomeController extends Controller
11
{
12
    /**
13
     * Create a new controller instance.
14
     *
15
     * @return void
16
     */
17
    public function __construct()
18
    {
19
        $this->middleware('auth');
20
    }
21

  
22
    /**
23
     * Show the application dashboard.
24
     *
25
     * @return \Illuminate\Contracts\Support\Renderable
26
     */
27
    public function index()
28
    {
29
        return view('home');
30
    }
31
}
app/Providers/RouteServiceProvider.php
21 21
     *
22 22
     * @var string
23 23
     */
24
    public const HOME = '/home';
24
    public const HOME = '/';
25 25

  
26 26
    /**
27 27
     * Define your route model bindings, pattern filters, etc.
app/User.php
21 21
     * @var array
22 22
     */
23 23
    protected $fillable = [
24
         'email',
24
         'name', 'email', 'password'
25 25
    ];
26 26

  
27 27
    /**
......
30 30
     * @var array
31 31
     */
32 32
    protected $hidden = [
33
        'remember_token',
33
        'remember_token', 'password'
34 34
    ];
35 35

  
36 36
    /**
database/migrations/2014_10_12_000000_CreatePasswordResetsTable.php
1
<?php
2

  
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6

  
7
class CreatePasswordResetsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('password_resets', function (Blueprint $table) {
17
            $table->string('email')->index();
18
            $table->string('token');
19
            $table->timestamp('created_at')->nullable();
20
        });
21
    }
22

  
23
    /**
24
     * Reverse the migrations.
25
     *
26
     * @return void
27
     */
28
    public function down()
29
    {
30
        Schema::dropIfExists('password_resets');
31
    }
32
}
database/migrations/2020_04_06_000000_CreateUsersTable.php
16 16
        Schema::create('users', function (Blueprint $table) {
17 17
            $table->id();
18 18

  
19
            $table->string('name');
19 20
            $table->string('email')->unique();
20 21

  
21 22
            $table->timestamp('email_verified_at')->nullable();
23
            $table->string('password');
22 24
            $table->rememberToken();
23 25
            $table->timestamps();
24 26
        });
resources/sass/app.scss
6 6

  
7 7
// Bootstrap
8 8
@import '~bootstrap/scss/bootstrap';
9

  
10
// Font Awesome
11
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
12
@import '~@fortawesome/fontawesome-free/scss/regular';
13
@import '~@fortawesome/fontawesome-free/scss/solid';
14
@import '~@fortawesome/fontawesome-free/scss/brands';
15

  
16
// Custom
17
@import 'custom';
resources/views/auth/login.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Login')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Login</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Login') }}</div>
15

  
16
                <div class="card-body">
17
                    <form method="POST" action="{{ route('login') }}">
18
                        @csrf
19

  
20
                        <div class="form-group row">
21
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
22

  
23
                            <div class="col-md-6">
24
                                <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
25

  
26
                                @error('email')
27
                                    <span class="invalid-feedback" role="alert">
28
                                        <strong>{{ $message }}</strong>
29
                                    </span>
30
                                @enderror
31
                            </div>
32
                        </div>
33

  
34
                        <div class="form-group row">
35
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
36

  
37
                            <div class="col-md-6">
38
                                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
39

  
40
                                @error('password')
41
                                    <span class="invalid-feedback" role="alert">
42
                                        <strong>{{ $message }}</strong>
43
                                    </span>
44
                                @enderror
45
                            </div>
46
                        </div>
47

  
48
                        <div class="form-group row">
49
                            <div class="col-md-6 offset-md-4">
50
                                <div class="form-check">
51
                                    <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
52

  
53
                                    <label class="form-check-label" for="remember">
54
                                        {{ __('Remember Me') }}
55
                                    </label>
56
                                </div>
57
                            </div>
58
                        </div>
59

  
60
                        <div class="form-group row mb-0">
61
                            <div class="col-md-8 offset-md-4">
62
                                <button type="submit" class="btn btn-primary">
63
                                    {{ __('Login') }}
64
                                </button>
65

  
66
                                @if (Route::has('password.request'))
67
                                    <a class="btn btn-link" href="{{ route('password.request') }}">
68
                                        {{ __('Forgot Your Password?') }}
69
                                    </a>
70
                                @endif
71
                            </div>
72
                        </div>
73
                    </form>
74
                </div>
75
            </div>
76
        </div>
77
    </div>
78
</div>
79
@endsection
resources/views/auth/passwords/confirm.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Confirm')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Confirm</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Confirm Password') }}</div>
15

  
16
                <div class="card-body">
17
                    {{ __('Please confirm your password before continuing.') }}
18

  
19
                    <form method="POST" action="{{ route('password.confirm') }}">
20
                        @csrf
21

  
22
                        <div class="form-group row">
23
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
24

  
25
                            <div class="col-md-6">
26
                                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
27

  
28
                                @error('password')
29
                                    <span class="invalid-feedback" role="alert">
30
                                        <strong>{{ $message }}</strong>
31
                                    </span>
32
                                @enderror
33
                            </div>
34
                        </div>
35

  
36
                        <div class="form-group row mb-0">
37
                            <div class="col-md-8 offset-md-4">
38
                                <button type="submit" class="btn btn-primary">
39
                                    {{ __('Confirm Password') }}
40
                                </button>
41

  
42
                                @if (Route::has('password.request'))
43
                                    <a class="btn btn-link" href="{{ route('password.request') }}">
44
                                        {{ __('Forgot Your Password?') }}
45
                                    </a>
46
                                @endif
47
                            </div>
48
                        </div>
49
                    </form>
50
                </div>
51
            </div>
52
        </div>
53
    </div>
54
</div>
55
@endsection
resources/views/auth/passwords/email.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Reset')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Reset</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Reset Password') }}</div>
15

  
16
                <div class="card-body">
17
                    @if (session('status'))
18
                        <div class="alert alert-success" role="alert">
19
                            {{ session('status') }}
20
                        </div>
21
                    @endif
22

  
23
                    <form method="POST" action="{{ route('password.email') }}">
24
                        @csrf
25

  
26
                        <div class="form-group row">
27
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
28

  
29
                            <div class="col-md-6">
30
                                <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
31

  
32
                                @error('email')
33
                                    <span class="invalid-feedback" role="alert">
34
                                        <strong>{{ $message }}</strong>
35
                                    </span>
36
                                @enderror
37
                            </div>
38
                        </div>
39

  
40
                        <div class="form-group row mb-0">
41
                            <div class="col-md-6 offset-md-4">
42
                                <button type="submit" class="btn btn-primary">
43
                                    {{ __('Send Password Reset Link') }}
44
                                </button>
45
                            </div>
46
                        </div>
47
                    </form>
48
                </div>
49
            </div>
50
        </div>
51
    </div>
52
</div>
53
@endsection
resources/views/auth/passwords/reset.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Reset')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Reset</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Reset Password') }}</div>
15

  
16
                <div class="card-body">
17
                    <form method="POST" action="{{ route('password.update') }}">
18
                        @csrf
19

  
20
                        <input type="hidden" name="token" value="{{ $token }}">
21

  
22
                        <div class="form-group row">
23
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
24

  
25
                            <div class="col-md-6">
26
                                <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>
27

  
28
                                @error('email')
29
                                    <span class="invalid-feedback" role="alert">
30
                                        <strong>{{ $message }}</strong>
31
                                    </span>
32
                                @enderror
33
                            </div>
34
                        </div>
35

  
36
                        <div class="form-group row">
37
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
38

  
39
                            <div class="col-md-6">
40
                                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
41

  
42
                                @error('password')
43
                                    <span class="invalid-feedback" role="alert">
44
                                        <strong>{{ $message }}</strong>
45
                                    </span>
46
                                @enderror
47
                            </div>
48
                        </div>
49

  
50
                        <div class="form-group row">
51
                            <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
52

  
53
                            <div class="col-md-6">
54
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
55
                            </div>
56
                        </div>
57

  
58
                        <div class="form-group row mb-0">
59
                            <div class="col-md-6 offset-md-4">
60
                                <button type="submit" class="btn btn-primary">
61
                                    {{ __('Reset Password') }}
62
                                </button>
63
                            </div>
64
                        </div>
65
                    </form>
66
                </div>
67
            </div>
68
        </div>
69
    </div>
70
</div>
71
@endsection
resources/views/auth/register.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Register')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Register</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Register') }}</div>
15

  
16
                <div class="card-body">
17
                    <form method="POST" action="{{ route('register') }}">
18
                        @csrf
19

  
20
                        <div class="form-group row">
21
                            <label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
22

  
23
                            <div class="col-md-6">
24
                                <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
25

  
26
                                @error('name')
27
                                    <span class="invalid-feedback" role="alert">
28
                                        <strong>{{ $message }}</strong>
29
                                    </span>
30
                                @enderror
31
                            </div>
32
                        </div>
33

  
34
                        <div class="form-group row">
35
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
36

  
37
                            <div class="col-md-6">
38
                                <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
39

  
40
                                @error('email')
41
                                    <span class="invalid-feedback" role="alert">
42
                                        <strong>{{ $message }}</strong>
43
                                    </span>
44
                                @enderror
45
                            </div>
46
                        </div>
47

  
48
                        <div class="form-group row">
49
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
50

  
51
                            <div class="col-md-6">
52
                                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
53

  
54
                                @error('password')
55
                                    <span class="invalid-feedback" role="alert">
56
                                        <strong>{{ $message }}</strong>
57
                                    </span>
58
                                @enderror
59
                            </div>
60
                        </div>
61

  
62
                        <div class="form-group row">
63
                            <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
64

  
65
                            <div class="col-md-6">
66
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
67
                            </div>
68
                        </div>
69

  
70
                        <div class="form-group row mb-0">
71
                            <div class="col-md-6 offset-md-4">
72
                                <button type="submit" class="btn btn-primary">
73
                                    {{ __('Register') }}
74
                                </button>
75
                            </div>
76
                        </div>
77
                    </form>
78
                </div>
79
            </div>
80
        </div>
81
    </div>
82
</div>
83
@endsection
resources/views/auth/verify.blade.php
1
@extends('layouts.app')
2

  
3
@section('title', 'Verify')
4

  
5
@section('breadcrumb')
6
    <li class="breadcrumb-item active" aria-current="page">Verify</li>
7
@endsection
8

  
9
@section('content')
10
<div class="container">
11
    <div class="row justify-content-center">
12
        <div class="col-md-8">
13
            <div class="card">
14
                <div class="card-header">{{ __('Verify Your Email Address') }}</div>
15

  
16
                <div class="card-body">
17
                    @if (session('resent'))
18
                        <div class="alert alert-success" role="alert">
19
                            {{ __('A fresh verification link has been sent to your email address.') }}
20
                        </div>
21
                    @endif
22

  
23
                    {{ __('Before proceeding, please check your email for a verification link.') }}
24
                    {{ __('If you did not receive the email') }},
25
                    <form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
26
                        @csrf
27
                        <button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
28
                    </form>
29
                </div>
30
            </div>
31
        </div>
32
    </div>
33
</div>
34
@endsection
resources/views/home.blade.php
1
@extends('layouts.app')
2

  
3
@section('content')
4
<div class="container">
5
    <div class="row justify-content-center">
6
        <div class="col-md-8">
7
            <div class="card">
8
                <div class="card-header">Dashboard</div>
9

  
10
                <div class="card-body">
11
                    @if (session('status'))
12
                        <div class="alert alert-success" role="alert">
13
                            {{ session('status') }}
14
                        </div>
15
                    @endif
16

  
17
                    You are logged in!
18
                </div>
19
            </div>
20
        </div>
21
    </div>
22
</div>
23
@endsection
resources/views/inc/navbar.blade.php
1
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
2
    <ul class="navbar-nav">
3
        <a class="navbar-brand" >{{config('app.name', 'MERLOT')}}</a>
4
        <li class="nav-item active">
5
            <a class="nav-link" href="/">Home</a>
6
        </li>
7
        <li class="nav-item">
8
            <a class="nav-link" href="/info">Info</a>
9
        </li>
10
        <li class="nav-item">
11
            <a class="nav-link" href="/services">Services</a>
12
        </li>
13
    </ul>
1
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
2
    <div class="container">
3
        <a class="navbar-brand" href="{{ url('/') }}">
4
            {{ config('app.name', 'Laravel') }}
5
        </a>
6
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
7
            <span class="navbar-toggler-icon"></span>
8
        </button>
9

  
10
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
11
            <!-- Left Side Of Navbar -->
12
            <ul class="navbar-nav mr-auto">
13

  
14
            </ul>
15

  
16
            <!-- Right Side Of Navbar -->
17
            <ul class="navbar-nav ml-auto">
18
                <!-- Authentication Links -->
19
                @guest
20
                    <li class="nav-item">
21
                        <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
22
                    </li>
23
                    @if (Route::has('register'))
24
                        <li class="nav-item">
25
                            <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
26
                        </li>
27
                    @endif
28
                @else
29
                    <li class="nav-item dropdown">
30
                        <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
31
                            {{ Auth::user()->name }} <span class="caret"></span>
32
                        </a>
33

  
34
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
35
                            <a class="dropdown-item" href="{{ route('logout') }}"
36
                               onclick="event.preventDefault();
37
                                                     document.getElementById('logout-form').submit();">
38
                                {{ __('Logout') }}
39
                            </a>
40

  
41
                            <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
42
                                @csrf
43
                            </form>
44
                        </div>
45
                    </li>
46
                @endguest
47
            </ul>
48
        </div>
49
    </div>
14 50
</nav>
resources/views/layouts/app.blade.php
1
<!DOCTYPE html>
2
<html lang="{{ config('app.locale', 'en') }}">
1
<!doctype html>
2
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
3 3
<head>
4 4
    <meta charset="utf-8">
5 5
    <meta name="viewport" content="width=device-width, initial-scale=1">
6 6

  
7
    <!-- CSRF Token -->
8
    <meta name="csrf-token" content="{{ csrf_token() }}">
9

  
7 10
    <title>{{ config('app.name', 'Dev') }} - @yield('title')</title>
8 11

  
9
    <!-- CSS styles -->
10
    <link href="{{ asset('css/app.css') }}" rel="stylesheet" type="text/css">
12
    <!-- Scripts -->
13
    <script src="{{ asset('js/app.js') }}" defer></script>
14

  
15
    <!-- Fonts -->
16
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
17
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
18

  
19
    <!-- Styles -->
20
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
11 21
</head>
12 22
<body>
13
        <nav aria-label="breadcrumb">
14
            <ol class="breadcrumb">
15
               @yield('breadcrumb')
16
            </ol>
17
        </nav>
18

  
19
    <div class="container">
20
        <div class="content">
21
            @yield('content')
22
        </div>
23

  
24
        <hr>
25
        <footer class="container">
26
            © 2020
27
        </footer>
23
    <div id="app">
24
        @include('inc/navbar')
25

  
26
        <main class="py-4">
27
            <div class="container">
28
                <nav aria-label="breadcrumb">
29
                    <ol class="breadcrumb">
30
                        @yield('breadcrumb')
31
                    </ol>
32
                </nav>
33

  
34
                <div class="content-area">
35
                    @yield('content')
36
                </div>
37

  
38
                <hr>
39
                <footer class="container">
40
                    © 2020
41
                </footer>
42
            </div>
43
        </main>
28 44
    </div>
29 45
</body>
30 46
</html>
routes/web.php
16 16
Route::get('/', 'PagesController@index');
17 17

  
18 18
Route::get('/artefact', 'ArtefactController@default');
19

  
20 19
Route::get('/artefact/{id}', 'ArtefactController@view');
21 20
Route::resource('/detail', 'DetailsController', array('only' => array('index', 'show')));
22 21

  
22
Auth::routes();
23 23

  
24
Route::get('/home', 'HomeController@index')->name('home');

Také k dispozici: Unified diff