67 lines
1.2 KiB
PHP
67 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\Video;
|
|
use App\Helpers\VideoStream;
|
|
use App\Traits\Multimedia;
|
|
|
|
class VideoController extends Controller
|
|
{
|
|
use Multimedia;
|
|
|
|
public function delete(Video $o)
|
|
{
|
|
$o->remove = TRUE;
|
|
$o->save();
|
|
|
|
return redirect()
|
|
->back();
|
|
}
|
|
|
|
public function deletes(Request $request,$id=NULL)
|
|
{
|
|
return view('catalog.deletereview',[
|
|
'catalog'=>is_null($id)
|
|
? Video::where('remove',1)
|
|
->with(['software.model.make'])
|
|
->paginate($request->input('list',self::list_deletes))
|
|
: Video::where('id',$id)
|
|
->paginate(1),
|
|
'return'=>url('v/deletes'),
|
|
'type'=>'video',
|
|
]);
|
|
}
|
|
|
|
public function duplicates(Request $request,$id=NULL)
|
|
{
|
|
return view('catalog.duplicatereview',[
|
|
'catalog'=>is_null($id)
|
|
? Video::duplicates()
|
|
->with(['software.model.make'])
|
|
->paginate($request->input('list',self::list_duplicates))
|
|
: Video::where('id',$id)
|
|
->paginate(1),
|
|
'return'=>url('v/duplicates'),
|
|
'type'=>'video',
|
|
]);
|
|
}
|
|
|
|
public function undelete(Video $o)
|
|
{
|
|
$o->remove = NULL;
|
|
$o->save();
|
|
|
|
return redirect()
|
|
->back();
|
|
}
|
|
|
|
public function view(Video $o)
|
|
{
|
|
if ($o->isReadable())
|
|
(new VideoStream($o->file_name(FALSE)))
|
|
->start();
|
|
}
|
|
} |