diff --git a/app/Http/Controllers/CheckoutController2.php b/app/Http/Controllers/CheckoutController2.php deleted file mode 100644 index 8e0c083..0000000 --- a/app/Http/Controllers/CheckoutController2.php +++ /dev/null @@ -1,52 +0,0 @@ -name_en = $request->fullName_en; - $instructor->name_bn = $request->fullName_bn; - $instructor->contact_en = $request->contactNumber_en; - $instructor->contact_bn = $request->contactNumber_bn; - $instructor->email = $request->emailAddress; - $instructor->role_id = $request->roleId; - $instructor->bio = $request->bio; - $instructor->designation = $request->designation; - $instructor->title = $request->title; - $instructor->status = $request->status; - $instructor->password = Hash::make($request->fullName_bn); - $instructor->language = 'en'; - $instructor->access_block = $request->access_block; - - if ($request->hasFile('image')) { - $imageName = rand(111, 999) . time() . '.' . $request->image->extension(); - $request->image->move(public_path('uploads/instructors'), $imageName); - $instructor->image = $imageName; - } - if ($instructor->save()) - return redirect()->route('instructor.index')->with('success', 'Data Saved'); - else - return redirect()->back()->withInput()->with('error', 'Please try again'); - } catch (Exception $e) { - // dd($e); - return redirect()->back()->withInput()->with('error', 'Please try again'); - } - } -} diff --git a/app/Http/Controllers/Students/DashboardController.php b/app/Http/Controllers/Students/DashboardController.php index a877e95..b34ba2d 100644 --- a/app/Http/Controllers/Students/DashboardController.php +++ b/app/Http/Controllers/Students/DashboardController.php @@ -13,6 +13,7 @@ public function index() { $enrollment = Enrollment::get(); $course = Course::get(); - return view('students.dashboard', compact('enrollment', 'course')); + $purchaseHistory = Enrollment::with(['course'])->orderBy('enrollment_date', 'desc')->get(); + return view('students.dashboard', compact('enrollment', 'course', 'purchaseHistory')); } } diff --git a/app/Http/Controllers/Students/sslController.php b/app/Http/Controllers/Students/sslController.php index 9e323cf..a04aa94 100644 --- a/app/Http/Controllers/Students/sslController.php +++ b/app/Http/Controllers/Students/sslController.php @@ -8,7 +8,7 @@ use App\Models\Payment; use App\Models\Enrollment; use App\Models\Checkout; -use Illuminate\Support\Facades\Session; +use Illuminate\Support\Facades\Session; class sslController extends Controller { @@ -53,11 +53,11 @@ public function store(Request $request){ # CUSTOMER INFORMATION $post_data['cus_name'] = $user->name_en; $post_data['cus_email'] = $user->email; - $post_data['cus_add1'] = "2no Gate"; - $post_data['cus_city'] = "Chattogram"; - $post_data['cus_state'] = "Chattogram"; - $post_data['cus_postcode'] = "4100"; - $post_data['cus_country'] = "Bangladesh"; + $post_data['cus_add1'] = "$user->address"; + $post_data['cus_city'] = "$user->city"; + $post_data['cus_state'] = "$user->state"; + $post_data['cus_postcode'] = "$user->postcode"; + $post_data['cus_country'] = "$user->country"; $post_data['cus_phone'] = $user->contact_en; $post_data['cus_fax'] = $user->contact_en; diff --git a/database/migrations/2023_11_25_034933_create_students_table.php b/database/migrations/2023_11_25_034933_create_students_table.php index 34ca7af..9718787 100644 --- a/database/migrations/2023_11_25_034933_create_students_table.php +++ b/database/migrations/2023_11_25_034933_create_students_table.php @@ -24,6 +24,11 @@ public function up(): void $table->text('bio')->nullable(); $table->string('profession')->nullable(); $table->string('nationality')->default('Bangladeshi')->nullable(); + $table->text('address')->nullable(); + $table->string('city')->nullable(); + $table->string('state')->nullable(); + $table->string('postcode')->nullable(); + $table->string('country')->nullable(); $table->boolean('status')->default(1)->comment('1 active, 0 inactive'); $table->string('password'); $table->string('language')->default('en'); diff --git a/resources/views/frontend/checkout.blade.php b/resources/views/frontend/checkout.blade.php index 582e395..dd4a66f 100644 --- a/resources/views/frontend/checkout.blade.php +++ b/resources/views/frontend/checkout.blade.php @@ -15,7 +15,7 @@ - +
diff --git a/resources/views/students/dashboard.blade.php b/resources/views/students/dashboard.blade.php index ec86285..c8f3d10 100644 --- a/resources/views/students/dashboard.blade.php +++ b/resources/views/students/dashboard.blade.php @@ -504,9 +504,11 @@ class="contentCard-user d-flex align-items-center"> {{-- Purchase History --}} {{-- Setting --}}
- + diff --git a/routes/web.php b/routes/web.php index cb50d40..b0683f6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -25,7 +25,7 @@ /* students */ use App\Http\Controllers\Students\AuthController as sauth; -use App\Http\Controllers\Students\DashboardController as studashboard; +use App\Http\Controllers\Students\DashboardController as studashboard; use App\Http\Controllers\Students\ProfileController as stu_profile; use App\Http\Controllers\Students\sslController as sslcz; /*