profileルートの名前を変更

This commit is contained in:
shibafu 2017-11-03 18:10:50 +09:00
parent abf8b05253
commit edcc2bceaf
5 changed files with 19 additions and 17 deletions

View File

@ -59,6 +59,6 @@ class EjaculationController extends Controller
$ejaculation = Ejaculation::findOrFail($id); $ejaculation = Ejaculation::findOrFail($id);
$user = User::findOrFail($ejaculation->user_id); $user = User::findOrFail($ejaculation->user_id);
$ejaculation->delete(); $ejaculation->delete();
return redirect()->route('profile', ['name' => $user->name])->with('status', '削除しました。'); return redirect()->route('user.profile', ['name' => $user->name])->with('status', '削除しました。');
} }
} }

View File

@ -10,8 +10,8 @@
<div class="card mb-4"> <div class="card mb-4">
<div class="card-body"> <div class="card-body">
<img src="{{ Auth::user()->getProfileImageUrl(64) }}" class="rounded mb-1"> <img src="{{ Auth::user()->getProfileImageUrl(64) }}" class="rounded mb-1">
<h4 class="card-title"><a class="text-dark" href="{{ route('profile') }}">{{ Auth::user()->display_name }}</a></h4> <h4 class="card-title"><a class="text-dark" href="{{ route('user.profile') }}">{{ Auth::user()->display_name }}</a></h4>
<h6 class="card-subtitle mb-4"><a class="text-muted" href="{{ route('profile') }}">&commat;{{ Auth::user()->name }}</a></h6> <h6 class="card-subtitle mb-4"><a class="text-muted" href="{{ route('user.profile') }}">&commat;{{ Auth::user()->name }}</a></h6>
<h6 class="font-weight-bold"><span class="oi oi-timer"></span> 現在のセッション</h6> <h6 class="font-weight-bold"><span class="oi oi-timer"></span> 現在のセッション</h6>
@if (isset($currentSession)) @if (isset($currentSession))

View File

@ -30,14 +30,14 @@
<li class="nav-item {{ stripos(Route::currentRouteName(), 'home') === 0 ? 'active' : ''}}"> <li class="nav-item {{ stripos(Route::currentRouteName(), 'home') === 0 ? 'active' : ''}}">
<a class="nav-link" href="{{ route('home') }}">ホーム</a> <a class="nav-link" href="{{ route('home') }}">ホーム</a>
</li> </li>
<li class="nav-item"> <li class="nav-item {{ stripos(Route::currentRouteName(), 'user.profile') === 0 ? 'active' : ''}}">
<a class="nav-link" href="{{ route('profile') }}">タイムライン</a> <a class="nav-link" href="{{ route('user.profile', ['name' => Auth::user()->name]) }}">タイムライン</a>
</li> </li>
<li class="nav-item"> <li class="nav-item {{ stripos(Route::currentRouteName(), 'user.stats') === 0 ? 'active' : ''}}">
<a class="nav-link" href="{{ route('profile') }}">グラフ</a> <a class="nav-link" href="{{ route('user.stats', ['name' => Auth::user()->name]) }}">グラフ</a>
</li> </li>
<li class="nav-item"> <li class="nav-item {{ stripos(Route::currentRouteName(), 'user.okazu') === 0 ? 'active' : ''}}">
<a class="nav-link" href="{{ route('profile') }}">オカズ</a> <a class="nav-link" href="{{ route('user.okazu', ['name' => Auth::user()->name]) }}">オカズ</a>
</li> </li>
{{--<li class="nav-item"> {{--<li class="nav-item">
<a class="nav-link" href="{{ route('ranking') }}">ランキング</a> <a class="nav-link" href="{{ route('ranking') }}">ランキング</a>

View File

@ -7,8 +7,8 @@
<div class="card mb-4"> <div class="card mb-4">
<div class="card-body"> <div class="card-body">
<img src="{{ $user->getProfileImageUrl(64) }}" class="rounded mb-1"> <img src="{{ $user->getProfileImageUrl(64) }}" class="rounded mb-1">
<h4 class="card-title"><a class="text-dark" href="{{ route('profile', ['name' => $user->name]) }}">{{ $user->display_name }}</a></h4> <h4 class="card-title"><a class="text-dark" href="{{ route('user.profile', ['name' => $user->name]) }}">{{ $user->display_name }}</a></h4>
<h6 class="card-subtitle mb-4"><a class="text-muted" href="{{ route('profile', ['name' => $user->name]) }}">&commat;{{ $user->name }}</a></h6> <h6 class="card-subtitle mb-4"><a class="text-muted" href="{{ route('user.profile', ['name' => $user->name]) }}">&commat;{{ $user->name }}</a></h6>
<h6 class="font-weight-bold"><span class="oi oi-timer"></span> 現在のセッション</h6> <h6 class="font-weight-bold"><span class="oi oi-timer"></span> 現在のセッション</h6>
@if (isset($currentSession)) @if (isset($currentSession))
@ -31,13 +31,13 @@
<div class="col-lg-8"> <div class="col-lg-8">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{ Route::currentRouteName() === 'profile' ? 'active' : '' }}" href="{{ route('profile') }}">タイムライン</a> <a class="nav-link {{ Route::currentRouteName() === 'user.profile' ? 'active' : '' }}" href="{{ route('user.profile', ['name' => $user->name]) }}">タイムライン</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#stats">グラフ</a> <a class="nav-link {{ Route::currentRouteName() === 'user.stats' ? 'active' : '' }}" href="{{ route('user.stats', ['name' => $user->name]) }}">グラフ</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#okazu">オカズ</a> <a class="nav-link {{ Route::currentRouteName() === 'user.okazu' ? 'active' : '' }}" href="{{ route('user.okazu', ['name' => $user->name]) }}">オカズ</a>
</li> </li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">

View File

@ -16,9 +16,11 @@ Auth::routes();
Route::get('/', 'HomeController@index')->name('home'); Route::get('/', 'HomeController@index')->name('home');
Route::get('/user', function() { Route::get('/user', function() {
return redirect()->route('profile', ['name' => Auth::user()->name]); return redirect()->route('user.profile', ['name' => Auth::user()->name]);
})->middleware('auth')->name('profile'); })->middleware('auth')->name('user.profile');
Route::get('/user/{name?}', 'UserController@profile')->name('profile'); Route::get('/user/{name?}', 'UserController@profile')->name('user.profile');
Route::get('/user/{name}/stats', 'UserController@stats')->name('user.stats');
Route::get('/user/{name}/okazu', 'UserController@okazu')->name('user.okazu');
Route::middleware('auth')->group(function () { Route::middleware('auth')->group(function () {
Route::get('/checkin', 'EjaculationController@create')->name('checkin'); Route::get('/checkin', 'EjaculationController@create')->name('checkin');