created a separate controller for watchCourse
Cette révision appartient à :
Parent
9d2e8720a1
révision
8b7344d065
@ -182,12 +182,12 @@ public function destroy($id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function watchCourse($id)
|
// public function watchCourse($id)
|
||||||
{
|
// {
|
||||||
$course = Course::findOrFail(encryptor('decrypt',$id));
|
// $course = Course::findOrFail(encryptor('decrypt',$id));
|
||||||
$category = CourseCategory::get();
|
// $category = CourseCategory::get();
|
||||||
$lessons = Lesson::where('course_id', $course->id)->get();
|
// $lessons = Lesson::where('course_id', $course->id)->get();
|
||||||
|
|
||||||
return view('frontend.watchCourse', compact('course', 'category', 'lessons'));
|
// return view('frontend.watchCourse', compact('course', 'category', 'lessons'));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
81
app/Http/Controllers/WatchCourseController.php
Fichier normal
81
app/Http/Controllers/WatchCourseController.php
Fichier normal
@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Watchlist;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Course;
|
||||||
|
use App\Models\CourseCategory;
|
||||||
|
use App\Models\Lesson;
|
||||||
|
|
||||||
|
class WatchCourseController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public function watchCourse($id)
|
||||||
|
{
|
||||||
|
$course = Course::findOrFail(encryptor('decrypt', $id));
|
||||||
|
$category = CourseCategory::get();
|
||||||
|
$lessons = Lesson::where('course_id', $course->id)->get();
|
||||||
|
|
||||||
|
return view('frontend.watchCourse', compact('course', 'category', 'lessons'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(Watchlist $watchlist)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(Watchlist $watchlist)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, Watchlist $watchlist)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(Watchlist $watchlist)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -67,6 +67,8 @@
|
|||||||
<!-- Course Description Starts Here -->
|
<!-- Course Description Starts Here -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row course-description">
|
<div class="row course-description">
|
||||||
|
|
||||||
|
{{-- Video Area --}}
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<div class="course-description-start">
|
<div class="course-description-start">
|
||||||
<div class="video-area">
|
<div class="video-area">
|
||||||
@ -508,13 +510,13 @@ class="button button-md button--primary float-end">Post
|
|||||||
@foreach ($lesson->material as $material)
|
@foreach ($lesson->material as $material)
|
||||||
<div class="main-wizard">
|
<div class="main-wizard">
|
||||||
<div class="main-wizard__wrapper">
|
<div class="main-wizard__wrapper">
|
||||||
<a class="main-wizard-start">
|
<a class="main-wizard-start" onclick="show_video('{{$material->content}}')">
|
||||||
@if ($material->type=='video')
|
@if ($material->type=='video')
|
||||||
<div class="main-wizard-icon" onclick="show_video('{{$material->content}}')">
|
<div class="main-wizard-icon">
|
||||||
<i class="far fa-play-circle fa-lg"></i>
|
<i class="far fa-play-circle fa-lg"></i>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="main-wizard-icon" onclick="show_video('{{$material->content}}')">
|
<div class="main-wizard-icon">
|
||||||
<i class="far fa-file fa-lg text-success"></i>
|
<i class="far fa-file fa-lg text-success"></i>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
use App\Http\Controllers\HomeController;
|
use App\Http\Controllers\HomeController;
|
||||||
use App\Http\Controllers\CheckoutController as checkout;
|
use App\Http\Controllers\CheckoutController as checkout;
|
||||||
use App\Http\Controllers\CouponController as coupon;
|
use App\Http\Controllers\CouponController as coupon;
|
||||||
|
use App\Http\Controllers\WatchCourseController as watchCourse;
|
||||||
|
|
||||||
/* students */
|
/* students */
|
||||||
use App\Http\Controllers\Students\AuthController as sauth;
|
use App\Http\Controllers\Students\AuthController as sauth;
|
||||||
@ -98,7 +99,8 @@
|
|||||||
Route::get('searchCourse', [course::class, 'frontIndex'])->name('searchCourse');
|
Route::get('searchCourse', [course::class, 'frontIndex'])->name('searchCourse');
|
||||||
Route::get('courseDetails/{id}', [course::class, 'frontShow'])->name('courseDetails');
|
Route::get('courseDetails/{id}', [course::class, 'frontShow'])->name('courseDetails');
|
||||||
|
|
||||||
Route::get('watchCourse/{id}', [course::class, 'watchCourse'])->name('watchCourse');
|
// Route::get('watchCourse/{id}', [course::class, 'watchCourse'])->name('watchCourse');
|
||||||
|
Route::get('watchCourse/{id}', [watchCourse::class, 'watchCourse'])->name('watchCourse');
|
||||||
|
|
||||||
Route::get('instructorProfile/{id}', [instructor::class, 'frontShow'])->name('instructorProfile');
|
Route::get('instructorProfile/{id}', [instructor::class, 'frontShow'])->name('instructorProfile');
|
||||||
Route::get('checkout', [checkout::class, 'index'])->name('checkout');
|
Route::get('checkout', [checkout::class, 'index'])->name('checkout');
|
||||||
|
|||||||
Chargement…
Référencer dans un nouveau ticket
Block a user