feat: Complete user profile section and update the navbar and add routs for profile
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ProfileController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
$registerTime = verta($user->created_at)->format('Y/m/d');
|
||||||
|
return view('dashboard.profile' , compact('user' , 'registerTime'));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
@extends('dashboard.layouts.app')
|
||||||
|
@section('title' , 'پروفایل')
|
||||||
|
|
||||||
|
@section('account-content')
|
||||||
|
<div class="user-profile-wrapper">
|
||||||
|
<div class="user-profile-card">
|
||||||
|
<h4 class="user-profile-card-title">پروفایل</h4>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="profile-info-list">
|
||||||
|
<ul>
|
||||||
|
<li>اسم کامل : <span>{{$user->first_name . ' ' . $user->last_name}}</span></li>
|
||||||
|
<li>ایمیل:
|
||||||
|
<span>
|
||||||
|
<a href="/cdn-cgi/l/email-protection" class="__cf_email__"
|
||||||
|
data-cfemail="680207061b0706280d10090518040d460b0705">
|
||||||
|
{{$user->email}}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li>شماره: <span>{{$user->mobile}}</span></li>
|
||||||
|
<li>تاریخ عضویت: <span>{{$registerTime}}</span></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -78,9 +78,9 @@
|
|||||||
<div class="header-nav-right">
|
<div class="header-nav-right">
|
||||||
<div class="header-btn">
|
<div class="header-btn">
|
||||||
@if(!auth()->check())
|
@if(!auth()->check())
|
||||||
<a href="{{route('auth.register.index')}}" class="theme-btn mt-2">ثبت نام</a>
|
<a href="{{route('auth.register.index')}}" class="theme-btn mt-2">ثبت نام | ورود</a>
|
||||||
@else
|
@else
|
||||||
<a href="{{route('dashboard.index')}}" class="theme-btn mt-2">{{auth()->user()->first_name . ' ' . auth()->user()->last_name}}</a>
|
<a href="{{route('profile')}}" class="theme-btn mt-2">{{auth()->user()->first_name . ' ' . auth()->user()->last_name}}</a>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\DashboardController;
|
||||||
|
use App\Http\Controllers\ProfileController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::get('profile' , [ProfileController::class , 'index'])->name('profile');
|
||||||
|
Route::get('dashboard' , [DashboardController::class , 'index'])->name('dashboard');
|
||||||
Reference in New Issue
Block a user