I was working on a API in Laravel. I don’t know what I did wrong but it keeps returning 200 OK but without any data.
this is api.php
:
Route::get('/offre/jobs', [OffreController::class, 'getAllJobs']);
this is my offerController :
//this will only return job type offers
public function getAllJobs()
{
$offres = Offre::where('type', 'job')->getAll();
return $offres;
}
this is my Offer model :
namespace AppModels;
use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateDatabaseEloquentModel;
class Offre extends Model
{
use HasFactory;
protected $fillable = [
'title',
'type',
'employmentType',
'workplace',
'description',
...
];
Whenever I try with my client (Thunder) it keeps returning 200 with empty body. I do know that I have data in my database that matches my query.