我正在创建一个管理面板,管理员可以编辑,删除用户,用户只能看到仪表板和主页。在主页上,我有用户配置文件和编辑按钮。问题是用户看不到编辑页面。我已经创建了另一个页面,如用户编辑,但用户无法访问它。
家.刀片.php
<div class="container">
<h1 class="my-4">Your Profile</h1>
<div class="row">
<div class="col-md-8">
<img class="profile-image-page mr-md-3" src="{{ (isset(Auth::user()->github_id)) ? (Auth::user()->avatar) : (asset('images/avatars/' . Auth::user()->avatar)) }}" alt="{{ Auth::user()->name}}">
</div>
<div class="col-md-4">
<h3 class="my-3">Account</h3>
<ul>
<li><b>ID: </b>{{ Auth::user()->id }}</li><hr>
<li><b>Name: </b>{{ Auth::user()->name }}</li><hr>
<li><b>Last Name: </b>{{ Auth::user()->lastname }}</li><hr>
<li><b>Email: </b>{{ Auth::user()->email }}</li><hr>
<li><b>Phone: </b>{{ Auth::user()->phone }}</li><hr>
<li><b>Job Title: </b>{{ Auth::user()->jobtitle }}</li><hr>
<li><b>Department: </b>{{ Auth::user()->department}}</li><hr>
<a href="/role-edit/{{ Auth::user()->id }}" class="btn btn-success">EDIT</a>
</ul>
</div>
</div>
网站.php
<?php
use App\User;
use App\Department;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('/page', function () {
return view('admin.page');
});
});
呼啦一阵风
汪汪一只猫
随时随地看视频慕课网APP