ダッシュボード画面の追加
This commit is contained in:
parent
f5fab4b3c1
commit
e69adbfbc3
14
app/Http/Controllers/Admin/DashboardController.php
Normal file
14
app/Http/Controllers/Admin/DashboardController.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('admin.dashboard');
|
||||
}
|
||||
}
|
BIN
public/dashboard.png
Normal file
BIN
public/dashboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
10
resources/views/admin/dashboard.blade.php
Normal file
10
resources/views/admin/dashboard.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'ダッシュボード')
|
||||
|
||||
@section('tab-content')
|
||||
<div class="container d-flex flex-column align-items-center">
|
||||
<img src="{{ asset('dashboard.png') }}" class="w-50"/>
|
||||
<p class="text-muted">TODO: 役に立つ情報を表示する</p>
|
||||
</div>
|
||||
@endsection
|
20
resources/views/layouts/admin.blade.php
Normal file
20
resources/views/layouts/admin.blade.php
Normal file
@ -0,0 +1,20 @@
|
||||
@extends('layouts.base')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item disabled font-weight-bold">管理</div>
|
||||
<a class="list-group-item list-group-item-action {{ Route::currentRouteName() === 'admin.dashboard' ? 'active' : '' }}"
|
||||
href="{{ route('admin.dashboard') }}"><span class="oi oi-dashboard mr-1"></span> ダッシュボード</a>
|
||||
<a class="list-group-item list-group-item-action"
|
||||
href=""><span class="oi oi-bullhorn mr-1"></span> お知らせ</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content col-lg-9">
|
||||
@yield('tab-content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -105,6 +105,9 @@
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="{{ route('setting') }}" class="dropdown-item">設定</a>
|
||||
@can ('admin')
|
||||
<a href="{{ route('admin.dashboard') }}" class="dropdown-item">管理</a>
|
||||
@endcan
|
||||
<a href="{{ route('logout') }}" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">ログアウト</a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -44,3 +44,11 @@ Route::get('/info/{id}', 'InfoController@show')->where('id', '[0-9]+')->name('in
|
||||
Route::redirect('/search', '/search/checkin', 301);
|
||||
Route::get('/search/checkin', 'SearchController@index')->name('search');
|
||||
Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag');
|
||||
|
||||
Route::middleware('can:admin')
|
||||
->namespace('Admin')
|
||||
->prefix('admin')
|
||||
->name('admin.')
|
||||
->group(function () {
|
||||
Route::get('/', 'DashboardController@index')->name('dashboard');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user