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 @@
{{count(session('cart', []))}} Courses in Cart
@php $total = 0 @endphp @if (session('cart')) - @foreach (session('cart') as $id => $details) - @php $total += $details['price'] * $details['quantity'] @endphp -
-
- course image -
-
-
{{$details['title_en']}} -
-

By {{$details['instructor']}}

-
-

- {{$details['price'] ? '$' . $details['price'] : 'Free'}} - {{$details['old_price'] ? '$' . $details['old_price'] : ''}} -

-
- - - + @foreach (session('cart') as $id => $details) + @php $total += $details['price'] * $details['quantity'] @endphp +
+
+ course image +
+
+
{{$details['title_en']}}
+

By {{$details['instructor']}}

+
+

+ {{$details['price'] ? '$' . $details['price'] : 'Free'}} + {{$details['old_price'] ? '$' . $details['old_price'] : ''}} +

+
+ + + +
+
-
-
- @endforeach + @endforeach @endif
diff --git a/resources/views/frontend/checkout.blade.php b/resources/views/frontend/checkout.blade.php index 4325c79..d8c1553 100644 --- a/resources/views/frontend/checkout.blade.php +++ b/resources/views/frontend/checkout.blade.php @@ -18,41 +18,12 @@
+ @if(request()->session()->get('studentLogin')) +
Checkout
-
@@ -93,45 +64,6 @@ Payment
- -
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
-
- - -
-
- -
-
@@ -142,45 +74,35 @@
-
-
- checkout -
-
-
- Gamification: Motivation Psychology & The - Art of Engagement. -
-

by Kevin Gibert

-
-
$12
-

$95

-
-
-
-
-
- checkout -
-
-
- Digital Art for Beginners - Unleash Your - Creativity -
-

by Kevin Gibert

-
-
$12
-

$95

-
-
+ @php $total = 0 @endphp + @if (session('cart')) + @foreach (session('cart') as $id => $details) + @php $total += $details['price'] * $details['quantity'] @endphp +
+
+ checkout +
+
+
+ {{$details['title_en']}} +
+

by {{$details['instructor']}}

+
+
{{$details['price'] ? '$' . $details['price'] : 'Free'}}
+

{{$details['old_price'] ? '$' . $details['old_price'] : ''}}

+ @endforeach + @endif + +
+
  • Subtotal

    -

    $49.99

    +

    {{'$' . number_format((float) $total, 2)}}

  • Coupon Discount

    @@ -192,7 +114,7 @@
  • Total:

    -

    $36.49

    +

    {{'$' . number_format((float) $total, 2)}}

@@ -200,8 +122,148 @@
+ @else + + + + + + + + + @endif
@endsection + +@push('scripts') + +@endpush \ No newline at end of file diff --git a/resources/views/students/Auth/login.blade.php b/resources/views/students/Auth/login.blade.php index c129fe9..55cc96e 100644 --- a/resources/views/students/Auth/login.blade.php +++ b/resources/views/students/Auth/login.blade.php @@ -11,7 +11,7 @@

Don't have account? Sign up

-
+ @csrf
@@ -60,13 +60,4 @@ class="img-fluid" />
- - -
- shape - shape -
- @endsection \ No newline at end of file diff --git a/resources/views/students/Auth/register.blade.php b/resources/views/students/Auth/register.blade.php index 1489d96..1b4bfe9 100644 --- a/resources/views/students/Auth/register.blade.php +++ b/resources/views/students/Auth/register.blade.php @@ -8,9 +8,8 @@