updated instuctor auth
@ -70,11 +70,11 @@ public function store(AddNewRequest $request)
|
||||
$user->role_id = $request->roleId;
|
||||
$user->status = $request->status;
|
||||
$user->password = Hash::make($request->password);
|
||||
if ($request->hasFile('image')) {
|
||||
$imageName = rand(111, 999) . time() . '.' . $request->image->extension();
|
||||
$request->image->move(public_path('uploads/users'), $imageName);
|
||||
$user->image = $imageName;
|
||||
}
|
||||
// if ($request->hasFile('image')) {
|
||||
// $imageName = rand(111, 999) . time() . '.' . $request->image->extension();
|
||||
// $request->image->move(public_path('uploads/users'), $imageName);
|
||||
// $user->image = $imageName;
|
||||
// }
|
||||
if ($user->save()) {
|
||||
DB::commit();
|
||||
$this->notice::success('Successfully saved');
|
||||
@ -161,7 +161,7 @@ public function update(UpdateRequest $request, $id)
|
||||
}
|
||||
return redirect()->back()->withInput()->with('error', 'Please try again');
|
||||
} catch (Exception $e) {
|
||||
dd($e);
|
||||
// dd($e);
|
||||
return redirect()->back()->withInput()->with('error', 'Please try again');
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public function signUpStore(SignUpRequest $request)
|
||||
else
|
||||
return redirect('login')->with('danger', 'Please Try Again');
|
||||
} catch (Exception $e) {
|
||||
// dd($e);
|
||||
dd($e);
|
||||
return redirect('login')->with('danger', 'Please Try Again');
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,7 @@ public function setSession($user)
|
||||
'roleIdentitiy' => encryptor('encrypt', $user->role->identity),
|
||||
'language' => encryptor('encrypt', $user->language),
|
||||
'image' => $user->image ?? 'No Image Found',
|
||||
'image' => $user?->instructor->image ?? 'No Image Found',
|
||||
'instructorImage' => $user?->instructor->image ?? 'No instructorImage Found',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -19,7 +19,6 @@ public function up(): void
|
||||
$table->string('contact_en')->unique();
|
||||
$table->string('contact_bn')->unique()->nullable();
|
||||
$table->unsignedBigInteger('role_id')->index();
|
||||
$table->unsignedBigInteger('instructor_id')->index();
|
||||
$table->string('password');
|
||||
$table->string('language')->default('en');
|
||||
$table->string('image')->nullable();
|
||||
@ -30,7 +29,6 @@ public function up(): void
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
|
||||
$table->foreign('instructor_id')->references('id')->on('instructors')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
29
database/migrations/2024_01_01_121113_add_column_to_user_table.php
Fichier normal
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('instructor_id')->index();
|
||||
$table->foreign('instructor_id')->references('id')->on('instructors')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('instructor_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
BIN
public/uploads/instructors/1231704120091.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
|
Avant Largeur: | Hauteur: | Taille: 55 KiB Après Largeur: | Hauteur: | Taille: 55 KiB |
BIN
public/uploads/instructors/1521704119941.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/1991704118011.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/3571704117863.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/3701704120487.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
|
Avant Largeur: | Hauteur: | Taille: 20 KiB Après Largeur: | Hauteur: | Taille: 20 KiB |
BIN
public/uploads/instructors/5011704117880.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/5621704117973.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/6091704120029.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
|
Avant Largeur: | Hauteur: | Taille: 274 KiB Après Largeur: | Hauteur: | Taille: 274 KiB |
|
Avant Largeur: | Hauteur: | Taille: 80 KiB Après Largeur: | Hauteur: | Taille: 80 KiB |
BIN
public/uploads/instructors/6661704117291.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 55 KiB |
BIN
public/uploads/instructors/7581704118352.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 55 KiB |
BIN
public/uploads/instructors/7761704117918.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/7871704118057.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/instructors/8091704117193.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 55 KiB |
|
Avant Largeur: | Hauteur: | Taille: 54 KiB Après Largeur: | Hauteur: | Taille: 54 KiB |
BIN
public/uploads/instructors/9231704120744.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 104 KiB |
BIN
public/uploads/users/7741704114296.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 255 KiB |
@ -148,7 +148,7 @@ class="ti-arrow-right"></i></a>
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
|
||||
<circle cx="12" cy="7" r="4"></circle>
|
||||
</svg>
|
||||
<span class="ml-2">Profile </span>
|
||||
<span class="ml-2">Profile</span>
|
||||
</a>
|
||||
<a href="email-inbox.html" class="dropdown-item ai-icon">
|
||||
<svg id="icon-inbox" xmlns="http://www.w3.org/2000/svg" width="18" height="18"
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="profile-photo">
|
||||
<img src="{{asset('public/uploads/users/'.request()->session()->get('image'))}}" class="img-fluid rounded-circle" height="140" width="140" alt="">
|
||||
<img src="{{asset('public/uploads/users/'.request()->session()->get('image'))}}" class="rounded-circle" height="140" width="140" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-9 col-12">
|
||||
|
||||