Added Seedbox to API

Added Seedbox to API
This commit is contained in:
cp6 2022-05-16 16:36:58 +10:00
parent ebb8edaac3
commit e1bbcc3c9f
2 changed files with 20 additions and 0 deletions

View File

@ -142,6 +142,23 @@ class ApiController extends Controller
return response($reseller, 200); return response($reseller, 200);
} }
protected function getAllSeedbox()
{
$reseller = DB::table('seedboxes as sb')
->Join('pricings as p', 'sb.id', '=', 'p.service_id')
->get(['sb.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT);
return response($reseller, 200);
}
protected function getSeedbox($id)
{
$reseller = DB::table('seedboxes as sb')
->Join('pricings as p', 'sb.id', '=', 'p.service_id')
->where('sb.id', '=', $id)
->get(['sb.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT);
return response($reseller, 200);
}
protected function getAllDomains() protected function getAllDomains()
{ {
$domains = DB::table('domains as d') $domains = DB::table('domains as d')

View File

@ -55,6 +55,9 @@ Route::middleware('auth:api')->get('providers/{id}', 'App\Http\Controllers\ApiCo
Route::middleware('auth:api')->get('reseller/', 'App\Http\Controllers\ApiController@getAllReseller'); Route::middleware('auth:api')->get('reseller/', 'App\Http\Controllers\ApiController@getAllReseller');
Route::middleware('auth:api')->get('reseller/{id}', 'App\Http\Controllers\ApiController@getReseller'); Route::middleware('auth:api')->get('reseller/{id}', 'App\Http\Controllers\ApiController@getReseller');
Route::middleware('auth:api')->get('seedbox/', 'App\Http\Controllers\ApiController@getAllSeedbox');
Route::middleware('auth:api')->get('seedbox/{id}', 'App\Http\Controllers\ApiController@getSeedbox');
Route::middleware('auth:api')->get('settings/', 'App\Http\Controllers\ApiController@getAllSettings'); Route::middleware('auth:api')->get('settings/', 'App\Http\Controllers\ApiController@getAllSettings');
Route::middleware('auth:api')->get('shared/', 'App\Http\Controllers\ApiController@getAllShared'); Route::middleware('auth:api')->get('shared/', 'App\Http\Controllers\ApiController@getAllShared');