Skip to content

v3.13.0

Latest
Compare
Choose a tag to compare
@n0nag0n n0nag0n released this 30 Oct 19:57
1307e8a

What's Changed

You can now easily add a new resource route to help standardize your API routes. For examples, defining a resource with Flight::resource('/posts', PostsController::class); will allow the following routes by default:

$defaultMapping = [
      'index' => 'GET ',
      'create' => 'GET /create',
      'store' => 'POST ',
      'show' => 'GET /@id',
      'edit' => 'GET /@id/edit',
      'update' => 'PUT /@id',
      'destroy' => 'DELETE /@id'
];

And the ensuing controller file will look like this:

class PostsController
{
    public function index(): void
    {
    }

    public function show(string $id): void
    {
    }

    public function create(): void
    {
    }

    public function store(): void
    {
    }

    public function edit(string $id): void
    {
    }

    public function update(string $id): void
    {
    }

    public function destroy(string $id): void
    {
    }
}

Full Changelog: v3.12.0...v3.13.0