Working interface and parsed symfony cast data to a database.
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\SymfonyCastDl\HtmlParser;
|
||||
use App\Http\SymfonyCastDl\SymfonyCastDlService;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
@@ -13,8 +11,4 @@ class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
|
||||
public function index(HtmlParser $htmlParser)
|
||||
{
|
||||
$service = new SymfonyCastDlService($htmlParser);
|
||||
}
|
||||
}
|
||||
|
||||
25
app/Http/Controllers/CourseController.php
Normal file
25
app/Http/Controllers/CourseController.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\SymfonyCastDl\HtmlParser;
|
||||
use App\Http\SymfonyCastDl\SymfonyCastDlService;
|
||||
use App\Models\Chapter;
|
||||
use App\Models\Course;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class CourseController extends Controller
|
||||
{
|
||||
public function index(Course $course): View
|
||||
{
|
||||
return view('course.index', compact('course'));
|
||||
}
|
||||
|
||||
public function chapter(Chapter $chapter, HtmlParser $htmlParser)
|
||||
{
|
||||
$service = new SymfonyCastDlService($htmlParser);
|
||||
$service->videoSize($chapter);
|
||||
|
||||
dd($chapter->toArray());
|
||||
}
|
||||
}
|
||||
23
app/Http/Controllers/Index.php
Normal file
23
app/Http/Controllers/Index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\SymfonyCastDl\HtmlParser;
|
||||
use App\Http\SymfonyCastDl\SymfonyCastDlService;
|
||||
use App\Models\Course;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$courses = Course::with('chapters')->withCount('chapters')->get();
|
||||
return view('index', compact(['courses']));
|
||||
}
|
||||
|
||||
public function download(HtmlParser $htmlParser)
|
||||
{
|
||||
$service = new SymfonyCastDlService($htmlParser);
|
||||
$service->getInfo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user