wyxos/laravel-resources

A plugin that implements the concept of resource management.

v1.4.0 2022-05-09 11:33 UTC

This package is auto-updated.

Last update: 2024-03-29 16:09:37 UTC


README

Please note that the repositories wyxos/laravel-listing and wyxos/laravel-resources are no longer maintained. They are now unified under wyxos/harmonie.

Laravel Resources

Add the concept of route handlers and resource handlers.

The aim of this package is:

  • Bypass the need to define controllers
  • Enforce defining route actions as string making renaming difficult
  • Reduce navigating to nested folders to reach Requests
// Create a route instance

php artisan make:route StoreUser

// Output

app/Routes/StoreUser.php

// Usage

Route::post('/users/store', StoreUser::class)

// Create a resource route instance

php artisan make:route User/Store --resource

// Output

app/Resources/User/Store.php

// Usage

route('resource', ['user', 'store'])