Laravel7でAdminLTEを使って管理画面を作成

概要

  • 管理画面を作成する

前提

環境

  • Laravel7
  • laravel-adminlte3.4

参考URL

手順

composer require jeroennoten/laravel-adminlte
composer require laravel/ui
php artisan ui:controllers
php artisan adminlte:install
php artisan adminlte:install --only=auth_views

ログイン画面がAdminLTEに切り替わっている。

home.blade.phpを下記に書き換える。

@extends('adminlte::page')

@section('title', 'Dashboard')

@section('content_header')
    <h1>Dashboard</h1>
@stop

@section('content')
    <p>Welcome to this beautiful admin panel.</p>
@stop

@section('css')
    <link rel="stylesheet" href="/css/admin_custom.css">
@stop

@section('js')
    <script> console.log('Hi!'); </script>
@stop

ログイン後はAminLTEデザインになっている。