PHPackages                             rafflesargentina/l8-restful-controller - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rafflesargentina/l8-restful-controller

ActiveLibrary

rafflesargentina/l8-restful-controller
======================================

RESTful Controller for Laravel 8

v1.1(4y ago)033MITPHPPHP &gt;=7.3

Since Jan 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rafflesargentina/l8-restful-controller)[ Packagist](https://packagist.org/packages/rafflesargentina/l8-restful-controller)[ Docs](https://github.com/rafflesargentina/l8-restful-controller)[ RSS](/packages/rafflesargentina-l8-restful-controller/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

RESTful Controller for Laravel 8
================================

[](#restful-controller-for-laravel-8)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bd9e143454af40189e7d449573b00b7f79bcff222e1fc26fd6ccfdb713c73b33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726166666c6573617267656e74696e612f6c352d7265736f757263652d636f6e74726f6c6c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafflesargentina/l5-resource-controller)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/06dd63d76429d0c05a7c59d549fcdc639ca6aef5b6ce5405e65dd9dd998d54e0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726166666c6573617267656e74696e612f6c352d7265736f757263652d636f6e74726f6c6c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rafflesargentina/l5-resource-controller)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c11b1bf723059bc3c7029c02a1e0d5ffe0c38e44ad17e469d978c138291c7bd2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726166666c6573617267656e74696e612f6c352d7265736f757263652d636f6e74726f6c6c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rafflesargentina/l5-resource-controller/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/2ff3583d72abb0c4016654592311aefb1b07b04315c062d91a93f4168c3c1eec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726166666c6573617267656e74696e612f6c352d7265736f757263652d636f6e74726f6c6c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafflesargentina/l5-resource-controller)

RESTful Controller for Laravel 8

Install
-------

[](#install)

Via Composer

```
$ composer require rafflesargentina/l5-resource-controller
```

Usage
-----

[](#usage)

Create a controller like you normally would and change it to extend ResourceController class. Then set $repository an $resourceName properties:

- $repository: The Repository class to instantiate.
- $resourceName: Set routes resource name.

Also you can set these optional properties:

- $alias: The alias for named routes.
- $theme: The location for themed views.
- $module: Set views vendor location prefix.
- $prefix : The vendor views prefix.
- $formRequest: The FormRequest class to instantiate (also take a look at [l5-action-based-form-request](https://github.com/rafflesargentina/l5-action-based-form-request)).
- $useSoftDeletes: Define if model uses SoftDeletes.
- $infoFlashMessageKey: The info flash message key.
- $errorFlashMessageKey: The info flash message key.
- $successFlashMessageKey: The info flash message key.
- $warningFlashMessageKey: The info flash message key.

Example:

```
