{{$details['title_en']}} -
- -
- {{$details['price'] ? '$' . $details['price'] : 'Free'}}
- {{$details['old_price'] ? '$' . $details['old_price'] : ''}}
-
diff --git a/app/Http/Controllers/CheckoutController.php b/app/Http/Controllers/CheckoutController.php index aadbefe..be3f320 100644 --- a/app/Http/Controllers/CheckoutController.php +++ b/app/Http/Controllers/CheckoutController.php @@ -6,5 +6,47 @@ class CheckoutController extends Controller { - // + /** + * Display a listing of the resource. + */ + public function index() + { + return view('frontend.checkout'); + } + + /** + * Store a newly created resource in storage. + */ + public function store(AddNewRequest $request) + { + try { + $instructor = new Instructor; + $instructor->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/AuthController.php b/app/Http/Controllers/Students/AuthController.php index effb9a1..a5f8f28 100644 --- a/app/Http/Controllers/Students/AuthController.php +++ b/app/Http/Controllers/Students/AuthController.php @@ -18,20 +18,20 @@ public function signUpForm() return view('students.auth.register'); } - public function signUpStore(SignUpRequest $request) + public function signUpStore(SignUpRequest $request,$back_route) { try { $student = new Student; $student->name_en = $request->name; $student->email = $request->email; $student->password = Hash::make($request->password); - if ($student->save()) - return redirect()->route('studentLogin')->with('success', 'Successfully Registered'); - else - return redirect()->route('studentLogin')->with('danger', 'Please Try Again'); + if ($student->save()){ + $this->setSession($student); + return redirect()->route($back_route)->with('success', 'Successfully Logged In'); + } } catch (Exception $e) { //dd($e); - return redirect()->route('studentLogin')->with('danger', 'Please Try Again'); + return redirect()->back()->with('danger', 'Please Try Again'); } } @@ -40,7 +40,7 @@ public function signInForm() return view('students.auth.login'); } - public function signInCheck(SignInRequest $request) + public function signInCheck(SignInRequest $request,$back_route) { try { $student = Student::Where('email', $request->email)->first(); @@ -48,16 +48,16 @@ public function signInCheck(SignInRequest $request) if ($student->status == 1) { if (Hash::check($request->password, $student->password)) { $this->setSession($student); - return redirect()->route('studentdashboard')->with('success', 'Successfully Logged In'); + return redirect()->route($back_route)->with('success', 'Successfully Logged In'); } else - return redirect()->route('studentLogin')->with('error', 'Username or Password is wrong!'); + return redirect()->back()->with('error', 'Username or Password is wrong!'); } else - return redirect()->route('studentLogin')->with('error', 'You are not an active user! Please contact to Authority'); + return redirect()->back()->with('error', 'You are not an active user! Please contact to Authority'); } else - return redirect()->route('studentLogin')->with('error', 'Username or Password is wrong!'); + return redirect()->back()->with('error', 'Username or Password is wrong!'); } catch (Exception $e) { //dd($e); - return redirect()->route('studentLogin')->with('error', 'Username or Password is wrong!'); + return redirect()->back()->with('error', 'Username or Password is wrong!'); } } diff --git a/resources/views/frontend/cart.blade.php b/resources/views/frontend/cart.blade.php index 258d3b0..69eebc0 100644 --- a/resources/views/frontend/cart.blade.php +++ b/resources/views/frontend/cart.blade.php @@ -25,31 +25,29 @@
- {{$details['price'] ? '$' . $details['price'] : 'Free'}}
- {{$details['old_price'] ? '$' . $details['old_price'] : ''}}
-
- by Kevin Gibert
-$95
- by {{$details['instructor']}}
+{{$details['old_price'] ? '$' . $details['old_price'] : ''}}
Subtotal
-$49.99
+{{'$' . number_format((float) $total, 2)}}
Coupon Discount
@@ -192,7 +114,7 @@Total:
-$36.49
+{{'$' . number_format((float) $total, 2)}}
Don't have account? + Sign up +
+ +Don't have account? Sign up
-