Git Product home page Git Product logo

laravelresources's Introduction

Laravel Resources

Laravel Resources Demo

Packagist Version Packagist Downloads Build Status Style Status Licence All Contributors Code Quality Code Coverage


Laravel Resources is a speed-up development package that allows you to create a boilerplate for Laravel apps with a default API structure.

Versions

Laravel Laravel Resources
7.x v1.7
8.x v2.x
9.x v2.x
10.x v3.x

Installation

Via Composer

$ composer require tiagomichaelsousa/laravelresources --dev

Usage

Create the resources

$ php artisan resources:create <model>

This command will create the Controller, the Request, the Policy, the API Resource and Collection and will also add the default routes for the API.

Publish configuration file

$ php artisan vendor:publish --provider="tiagomichaelsousa\LaravelResources\LaravelResourcesServiceProvider" --tag="config"

Notes:

  • This package is fully configurable. You can change all the namespaces for the resources that will be created in the config file.
  • Don't forget to edit the request file in order to add your default validation for the model.
  • Don't forget to edit the policy file in order to fulfill your app business logic.

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

With test coverage

$ composer test-report

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email the author instead of using the issue tracker.

Credits

License

License MIT. Please see the license file for more information.

Code Of Conduct

Please see the code of conduct for more information.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Rafael Ferreira

๐Ÿ“–

tiagomichaelsousa

๐Ÿ’ป ๐Ÿ“– ๐Ÿ–‹ ๐Ÿ‘€

White Hyena

๐Ÿ’ป ๐Ÿ–‹

Keunbae Park

๐Ÿ’ป ๐Ÿ–‹

This project follows the all-contributors specification. Contributions of any kind welcome!

laravelresources's People

Contributors

allcontributors[bot] avatar angtheod avatar pkboom avatar rafaelferreiratvd avatar stephanesoares avatar tiagomichaelsousa avatar white-hyena avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravelresources's Issues

Config models.namespace doesn't work

When I changed value of laravel-resources.models.namespace then I expects that when I will write php artisan resources:create Test this will create model Test in right namespace. But this doesn't work.

Example
I had changed the configuration on App\Models after that I ran php artisan resources:create Test.

After that the model still is generated in /app directory but with namespace App\Models

The "-s" option does not exist.

When running the command "php artisan resources:create Article"
On this level below, when I press enter it throws the error, The "-s" option does not exist.
Should I create the seeder for Article? (yes/no) [yes]:

I don't know whether that is the intended behaviour or not but probably it seems like an error to me.
But thanks for this great package probably I am going to make a simple article and a youtube video on how to use this package it really comes in handy.

Validate method

Hello ! I just downloaded your package and I think it's great ! It really increases productivity, I only wish I discovered it sooner.

There's one thing I'm wondering though, maybe a silly thing. Why not use validate() method in the controller instead of request -> all() ?

Thanks again for that great package.

The "-f" option does not exist.

Lumen V 6.3.3
While i'm creating php artisan resources:create Post
On
Should I create the seeder for Post?
The "-f" option does not exist.

Laravel 8 support

There are a lot of breaking changes from L7 to L8 like:

  • factories are now class-based;
  • the route system has changed;
  • the new App\Models folder (this was already supported);

To keep support to L7 and add support to L8 a new release of this package must be made.

The new LaravelResources v.2.0 should be implemented with full support for L8

People that keep working with L7 should be able to pull the LaravelResources v.1.7 version

  • Collections
  • Resources
  • Controllers
  • Factories
  • Migrations
  • Models
  • Policies
  • Form Requests
  • Routes
  • Seeders

when i try to install laravelResource on laravel 10

/composer.json has been updated
Running composer update tiagomichaelsousa/laravelresources
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- tiagomichaelsousa/laravelresources[v1.0, ..., v1.3] require illuminate/support ~5|~6 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44] but these were not loaded, likely because it conflicts with another require.
- tiagomichaelsousa/laravelresources[v1.4, ..., v1.7] require illuminate/support ^7.0 -> found illuminate/support[v7.0.0, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require.
- tiagomichaelsousa/laravelresources[v1.8, v2.0] require illuminate/support ^7.0|^8.0 -> found illuminate/support[v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- tiagomichaelsousa/laravelresources v2.0.1 requires illuminate/support ^7.0|^8.0|^9.0 -> found illuminate/support[v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.7] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires tiagomichaelsousa/laravelresources * -> satisfiable by tiagomichaelsousa/laravelresources[v1.0, ..., v1.8, v2.0, v2.0.1].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require tiagomichaelsousa/laravelresources:*" to figure out if any version is installable, or "composer require tiagomichaelsousa/laravelresources:^2.1" if you know which you need.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.