Yes definitely, you can make APIs using all models of your OctoberCMS.
You have to make routes.php
file in your Plugin directory where your all models belong. And in routes.php
file you have to maintain your results with queries.
Example of routes.php
file is below:
<?php
//Here you have to define your route.
Route::get('api/v1/your_route', function () {
$result = []; //define a variable as array
$wartaProfiles= \WartaProfil::where('id','1')->get();;
$jadwalKeb = \JadwalKeb::all();
$result['wartaProfiles'] = $wartaProfiles;
$result['jadwalKeb'] = $jadwalKeb;
return $result;
});
I have two models Recipe and Category so I have mixed both models results in $result and returning it.
Now you can define your models and do whatever results you want.
For more information about retrieving results from models, visit this Retrieving multiple models.
That's all form my side. Hope this will help you.
Comment if you have any doubts.