Привіт, можливо підскажите цікавіше рішення...
Є 1 Controller => при отримані запиту в метод з header-oм => Accept (html/json) - повертати відповідь View || json
Моє рішення
class ResController extends Controller {
private $isView;
public function __constructor(){
$accept = $request->header('Accept');
$this->isView = ends_with($accept,'html');
}
public function index(){
$result = array();
return ($this->isView ? View('resources.index', $result) :
response()->json($result);
}
}
Разыскивается Middle\Senior PHP developer, вилка ЗП 1500-3000$.
Middle\Senior PHP developer (remote)
Looking for experienced web-developers.
Experience with highload projects is a great plus!
Remote.
Salary - according to results of the interview.
The main requirements:
Please don't contact us if you: