Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST feature divided into two, REST and Resource #6

Closed
wants to merge 4 commits into from

Conversation

Costamilam
Copy link
Contributor

REST for APIs
Resource for monolithic architecture

@Costamilam Costamilam changed the title REST resource divided into two, REST and Resource REST feature divided into two, REST and Resource Jul 15, 2019
REST for APIs
Resource for monolithic architecture
@Costamilam Costamilam force-pushed the master branch 2 times, most recently from 08d3023 to be7ca3f Compare July 18, 2019 14:20
@brcontainer brcontainer closed this Jun 1, 2024
@brcontainer
Copy link
Member

Classe Inphinit\Experimental\Rest e Inphinit\Experimental\Quick, anteriore experimentais, foram substituidas por Inphinit\Resource e Inphinit\Treaty.

Exemplo de uso:

Group::create()->path('/treaty/')->then(function () {
    \Controller\TreatySample::action();

    /*
    Is equivant to:

    Route::set('GET', '/', 'TreatySample:getIndex');
    Route::set('ANY', '/foo-bar-baz', 'TreatySample:anyFooBarBaz');
    */
});

Group::create()->path('/resource/')->then(function () {
    \Controller\ResourceSample::action();

    /*
    Is equivant to:

    Route::set('GET', '/', 'ResourceSample:index');
    Route::set('GET', '/create', 'ResourceSample:create');
    Route::set('POST', '/', 'ResourceSample:store');
    Route::set('GET', '/{:[^/]+:}/edit', 'ResourceSample:edit');
    Route::set('GET', '/{:[^/]+:}', 'ResourceSample:show');
    Route::set('PUT', '/{:[^/]+:}', 'ResourceSample:update');
    Route::set('DELETE', '/{:[^/]+:}', 'ResourceSample:destroy');
    */
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants