Added note to API

This commit is contained in:
cp6 2024-12-09 19:09:20 +11:00
parent 6f59fb628c
commit 5445e9d67f
2 changed files with 9 additions and 0 deletions

View file

@ -7,6 +7,7 @@ use App\Models\IPs;
use App\Models\Labels;
use App\Models\Misc;
use App\Models\NetworkSpeed;
use App\Models\Note;
use App\Models\OS;
use App\Models\Pricing;
use App\Models\Providers;
@ -500,4 +501,10 @@ class ApiController extends Controller
return response($yabs, 200);
}
protected function getNote($id)
{
$note = Note::where('id', $id)->firstOrFail('note')->pluck('note');
return response($note, 200)->header('Content-Type', 'text/plain');
}
}

View file

@ -77,3 +77,5 @@ Route::middleware('auth:api')->get('dns/{domainName}/{type}', 'App\Http\Controll
Route::middleware('throttle:4')->post('yabs/{server}/{key}', 'App\Http\Controllers\ApiController@storeYabs')->name('api.store-yabs');
Route::middleware('auth:api')->get('yabs/', 'App\Http\Controllers\ApiController@getAllYabs');
Route::middleware('auth:api')->get('yabs/{id}', 'App\Http\Controllers\ApiController@getYabs');
Route::middleware('auth:api')->get('note/{id}', 'App\Http\Controllers\ApiController@getNote');