sonarrradarrplexorganizrnginxdashboardlandingpagestartpagelandinghtpcserverhomepagesabnzbdheimdallembycouchpotatonzbgetbookmarkapplication-dashboardmuximux
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
741 B
28 lines
741 B
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Search;
|
|
|
|
class SearchController extends Controller
|
|
{
|
|
public function index(Request $request)
|
|
{
|
|
$requestprovider = $request->input('provider');
|
|
$query = $request->input('q');
|
|
|
|
$provider = Search::providerDetails($requestprovider);
|
|
|
|
if($provider->type == 'standard') {
|
|
return redirect($provider->url.'?'.$provider->var.'='.urlencode($query));
|
|
} elseif($provider->type == 'external') {
|
|
$class = new $provider->class;
|
|
//print_r($provider);
|
|
return $class->getResults($query, $provider);
|
|
}
|
|
|
|
//print_r($provider);
|
|
}
|
|
}
|
|
|