Answers for "composer require sprintcube/cakephp-rest"

PHP
0

composer require sprintcube/cakephp-rest

composer require sprintcube/cakephp-rest


bin/cake plugin load -b Rest


$routes->connect('/foo/bar', ['controller' => 'Foo', 'action' => 'bar', 'isRest' => true]);


namespace App\Controller\Api;
use Rest\Controller\RestController;
class ProductsController extends RestController

public function beforeFilter(Event $event)
{
parent::beforeFilter($event);
      
$this->response->cors($this->request)
->allowOrigin('*')
->allowMethods(['GET', 'PUT', 'POST', 'OPTIONS'])
->allowHeaders(['X-CSRF-Token'])
->allowCredentials()
->maxAge(300)
->build();
}
Posted by: Guest on October-27-2020

Code answers related to "composer require sprintcube/cakephp-rest"

Browse Popular Code Answers by Language