GithubHelp home page GithubHelp logo

andreacivita / laravel-apicrudgenerator Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 3.0 87 KB

Generates api with artisan command

License: MIT License

PHP 100.00%
api crud crud-generator generator hacktoberfest laravel laravel-api laravel-package php

laravel-apicrudgenerator's Introduction

๐Ÿ‘‹ Hello Folks! I'm Andrea Civita

I am Andrea Civita, PHP Web Developer at Immobiliare.it. I am a tech enthusiast & an open-source advocate. I am always open to collaborating on projects and innovative/disruptive ideas. Find out more about me & feel free to connect with me here:

Andrea Civita Linkedin Andrea Civita Instagram Andrea Civita mail

Tech Skills:


laravel-apicrudgenerator's People

Contributors

andreacivita avatar codacy-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-apicrudgenerator's Issues

how make secure?

Dear bro, ur code generator api is good. i have been setup in my classified script, its working. but how make secure example if want access api must have login user (email & pass) combine with expired token

php artisan make:crud --all fails with messaage

php artisan make:crud --all generates exception in console

Steps to reproduce the behavior:

  1. Start a fresh Laravel 8 project using composer and open it in VSCode
  2. Connect to a db with a table in it
  3. Run commands for installing and compiling package with option 0 (install all tags)
  4. Run the command above in console.

Expected behavior
Command completes successfully, but it fails with Type error

Screenshots
image

Desktop (please complete the following information):

  • OS: Win 10
  • Browser: Chrome
  • Version Version 106.0.5249.119

Write Unit test

Add Unit test (with PHPUnit) for this project.
Try to cover 100% of code.

Method all( ) is not working

Describe the bug
Method all is using CRUD table and not working for other db

To Reproduce
Steps to reproduce the behavior:

  1. Use db not named 'crud'
  2. php artisan make:crud --all
  3. See error "not finding tables_in_crud"

Add model properties from table's columns

It would be awesome to have model @property :type :name in Model class during generation.

Property name and type could be retrieved from table columns.

E.g:

in users table we could have:

name varchar(50) that will produce

<?php
...

/**
* @property string $name
*/
class User extends Model {
    ...
}

Missing namespace in Factory

Describe the bug
Namespace in factory stub is missing, and should be namespace Database\Factories. It will cause an error using this factory.

To Reproduce
Steps to reproduce the behavior:

  1. php artisan make:crud --interactive
  2. Fill with data...
  3. Factory file in database/factories/FooFactory.php has no namespace

Optimize import in generated files

Some stub files has not optimized import. It would be nice to fix this.

E.g. (supposing Model name is Car in namespace App\Models

in Test stub, setUp method is:

public function setUp() : void
    {
        parent::setUp();

        $this->car = \App\Models\Car::factory()->make();
    }

and should be

use App\Models\Car;

public function setUp() : void
    {
        parent::setUp();

        $this->car = Car::factory()->make();
    }

This should be applied to all stubs, and it will produce optimized imports and better code.

Singular name error in non-english names

Singular name error in non-english names
In italian routes singular_name( ) return wrong results.

To Reproduce
Steps to reproduce the behavior:

  1. php artisan make:crud Categoria --table categorie
  2. See error

Expected behavior

Model's name should be used instead of singular_name()

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.