2022-07-14 11:22:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
2022-07-26 06:36:47 +00:00
|
|
|
namespace App\Http\Controllers\API;
|
2022-07-14 11:22:39 +00:00
|
|
|
|
2022-07-14 12:22:10 +00:00
|
|
|
use App\Http\Resources\CountryResource;
|
2022-08-09 10:30:08 +00:00
|
|
|
use App\Http\Resources\CategoryResource;
|
2022-07-14 11:22:39 +00:00
|
|
|
use App\Models\Country;
|
2022-08-09 10:30:08 +00:00
|
|
|
use App\Models\Category;
|
2022-07-26 06:36:47 +00:00
|
|
|
use App\Http\Controllers\Controller;
|
2022-08-29 17:44:40 +00:00
|
|
|
use App\Http\Resources\QuestionResource;
|
|
|
|
|
use App\Models\Question;
|
2022-07-14 11:22:39 +00:00
|
|
|
|
2022-07-14 12:22:10 +00:00
|
|
|
class ResourceController extends Controller
|
2022-07-14 11:22:39 +00:00
|
|
|
{
|
2022-09-20 08:03:28 +00:00
|
|
|
public function countries()
|
|
|
|
|
{
|
2022-07-14 12:22:10 +00:00
|
|
|
return CountryResource::collection(Country::all());
|
2022-07-14 11:22:39 +00:00
|
|
|
}
|
2022-08-02 10:12:09 +00:00
|
|
|
|
2022-09-20 08:03:28 +00:00
|
|
|
public function categories()
|
|
|
|
|
{
|
2022-08-09 10:30:08 +00:00
|
|
|
return CategoryResource::collection(Category::all());
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-20 08:03:28 +00:00
|
|
|
public function faqs()
|
|
|
|
|
{
|
2022-12-13 07:32:54 +00:00
|
|
|
return QuestionResource::collection(Question::get());//todo investigate do we need all??
|
2022-08-29 17:44:40 +00:00
|
|
|
}
|
|
|
|
|
|
2022-07-14 11:22:39 +00:00
|
|
|
}
|