ダッシュボード画面の追加

This commit is contained in:
shibafu 2019-02-11 15:35:31 +09:00
parent f5fab4b3c1
commit e69adbfbc3
6 changed files with 55 additions and 0 deletions

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View 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

View 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

View File

@ -105,6 +105,9 @@
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a href="{{ route('setting') }}" class="dropdown-item">設定</a> <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> <a href="{{ route('logout') }}" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">ログアウト</a>
</div> </div>
</li> </li>

View File

@ -44,3 +44,11 @@ Route::get('/info/{id}', 'InfoController@show')->where('id', '[0-9]+')->name('in
Route::redirect('/search', '/search/checkin', 301); Route::redirect('/search', '/search/checkin', 301);
Route::get('/search/checkin', 'SearchController@index')->name('search'); Route::get('/search/checkin', 'SearchController@index')->name('search');
Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag'); 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');
});