Coder Social home page Coder Social logo

sohelamin / crud-generator Goto Github PK

View Code? Open in Web Editor NEW
1.4K 1.4K 424.0 447 KB

Laravel CRUD Generator

Home Page: https://packagist.org/packages/appzcoder/crud-generator

License: MIT License

PHP 98.92% Blade 1.08%
api-generator crud-generator generator laravel laravel-crud-generator php

crud-generator's People

Contributors

alimranahmed avatar antrouss avatar changeplaces avatar ebisbe avatar eduardoarandah avatar glgeorgiev avatar goszowski avatar jonashamm avatar jonstavis avatar landjea avatar lk77 avatar marcosrocha85 avatar mikebywater avatar mojoblanco avatar raulneis avatar raymondelooff avatar remailednet avatar rew-ind avatar sangezar avatar siegerhansma avatar sohelamin avatar thetodd avatar thickas avatar tirjok avatar unilance avatar wink- 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  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

crud-generator's Issues

Migrate OK. Rollback KO

Hello,

I've created a new crud and it went all fine. I can run the migration but the rollback is not working. It should work out of the box, right?

[07:51 AM]-[vagrant@local]-[/var/www/adinton_2]-[git master]
$ php artisan migrate
Migrated: 2016_03_08_075157_create_bannedips_table

[07:53 AM]-[vagrant@local]-[/var/www/adinton_2]-[git master]
$ php artisan migrate:rollback
PHP Fatal error:  Class 'CreateBannedipsTable' not found in /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 336
PHP Stack trace:
PHP   1. {main}() /var/www/adinton_2/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /var/www/adinton_2/artisan:36
PHP   3. Symfony\Component\Console\Application->run() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/adinton_2/vendor/symfony/console/Application.php:117
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/adinton_2/vendor/symfony/console/Application.php:186
PHP   6. Illuminate\Console\Command->run() /var/www/adinton_2/vendor/symfony/console/Application.php:791
PHP   7. Symfony\Component\Console\Command\Command->run() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
PHP   8. Illuminate\Console\Command->execute() /var/www/adinton_2/vendor/symfony/console/Command/Command.php:256
PHP   9. Illuminate\Container\Container->call() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
PHP  10. call_user_func_array:{/var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Container/Container.php:507}() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
PHP  11. Illuminate\Database\Console\Migrations\RollbackCommand->fire() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
PHP  12. Illuminate\Database\Migrations\Migrator->rollback() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php:63
PHP  13. Illuminate\Database\Migrations\Migrator->runDown() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:181
PHP  14. Illuminate\Database\Migrations\Migrator->resolve() /var/www/adinton_2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:227


  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'CreateBannedipsTable' not found

I know I can add the Class to composer but I think it should work all without requiring anything more.

Dumb question

Hey,

it's a dumb question, but what does "SL." stand for?

Thank you :)

Upload

how can I upload new file via admin?

Adding new columns to an existing crud

Hello,

Let's say we have a users table which has already created by crud:generate function and it has colums like below,

username | password | age

now i want to add another colums to this table which is "city" and table will be like below.

username | password | age | city

Is there a way to automatically add this column to all my views without changing my own changes in view files?

thank you.

Requirement

Please, how can i link the path from view stub with my private views. Can i use a config files to define the target of views. I want to use in composer json the original appzcoder but i don't wont to modified my views after update.
Thank you very much

Too many arguments.

Hi there, trying to generate CRUD, but I get the following error (please see below):

One of my colleagues tried it and it works 100% on his side. Any help will be much appreciated.
Thank you for the great contribution.

php artisan crud:generate Clients --fields=“organization_name#string#required, registered_name#string#required, organization_type_id#integer#required, registration_number#integer#required, vat_number#string, vendor_number#string, switchboard_number#string#required, fax_number#string, company_email_address#string#required, physical_address#text, postal_address#text#required, industry_id#integer, country_id#integer#required, province_id#integer#required, city_id#integer#required, suburb#string#required, notes#text” --route=yes --view-path=“backend” --route-group=“backend”

Error:
←[37;41m ←[39;49m ←[37;41m [Symfony\Component\Console\Exception\RuntimeException] ←[39;49m ←[37;41m Too many arguments. ←[39;49m ←[37;41m ←[39;49m

assertion "newSize >= 0" failed: file "main.cc", line 232, function: std::string convertPosixPathToWin(const string&) Aborted (core dumped)

After running this: php artisan crud:generate Members --fields="membershiptype:string:required, firstname:string:required, lastname:string:required, middlename:string:required, emailaddress:string, cellphonenumber:string, residenceadd:string, residencetelephoneno:string, residencefaxno:string, officeadd:string" --route=yes --pk=id --view-path="admin" --namespace=Admin --route-group=admin

It returns me that error

Required fields wrong

Since a few days the required fields are coming out like this

$this->validate($request, [requiredrequired]);

This seems all wrong? Any idea what might have happened?

Change buttons in "show"

In show view, update buttons work much better when placed above title.

The reason is that on mobile you don't need to scroll to find the buttons, they appear right there in front of your eyes

desktop

clipboard01

Mobile

2

A few issues

I'm new to laravel so this may be an error on my end, however I am encountering the following issues.

When generating controllers with

php artisan crud:generate Posts --route=yes --view-path="admin" --namespace=Admin --route-group=admin

I get the controller and model in the proper namespace, and the route is correct in routes.php. However, the controller class is empty. None of the methods are generated. And no views are generated.

When I try to generate just a controller, say, if I wanted a separate UsersController within Admin, I am unable to use --route or --namespace as option. This essentially means that I am unable to create the controller within Admin.

Any attempt to generate views for any controller results in a Symfony undefined offset: 1 error.

Create own generated files

Hello. Thanks for lib. I need generate in laravel 5 rest api routes, models and controllers without views and with my predefined code. IS it possible ?

Can only create 3 column header on view

Hi,
I found this code in CrudViewCommand.php at line 135.

        ...
        foreach ($formFields as $key => $value) {
                    // Why this loop is limited by 3
                    if ($i == 3) {
                        break;
                    }

                    $field = $value['name'];
                    $label = ucwords(str_replace('_', ' ', $field));
                    $formHeadingHtml .= '<th>' . $label . '</th>';
        ...
        }

What is exactly the limitation until 3 for..?
I think that should not be limited.

Thanks.

Enum Field Type

Hi Sohel,

As the first I liked your Scaffold App.
Will crud-generator supports 'Enum' field type?

Undefined $errors variable in Views files

I generated the crud using crud:generator

and I got this error in create.blade.php:
ErrorException in 86deb27e9df1247c4b24cb5279485f5f849ab29b.php line 11:
Undefined variable: errors (View: /opt/lampp/htdocs/events/resources/views/admin/days/create.blade.php)

Stub assumptions

I found out that the stub assumes the primary key column is "id", and that the model is "timestampable". As a first time laravel user, im not sure, but is there a way to override the stub?

thanks you for the great work!

Crud Issue

HI,

I need some information, your crud generator is really awesome, well let me know i don't to generate the migration, i need only controller, model and views only, also route. but when i generate crud through your command, then in model my table name is automatically called with factories, instead of factory. so that is issue number 1.

2nd most important thing is when you write only (php artisan crud:generate TableName) and press enter it only create model/controller and route. why not create view, it should create view based on table columns, if table columns is already exist. so this is my suggestion please add this feature.

3rd thing after giving complete columns through command then your view only create four table heading in listing view plus migration which i don't need if i have already migration class exist.

4th thing what about foreign keys if we want dropdown as select tag then in your view you need to pull data from database table and display as option in select tag,
for example:
I have country field like pakistan, bangladesh, and their values are 1, 2 so i need them while create.

Hope you understand.

Please let me know.

Best Regards
Muhammad Adil

Tests missing

Probably it would be good to add some tests to assure that nothing breaks in the next releases

won't generate from DB

I've tried a lot of things to get it to work, but I can't get it to use the tables in the database as the reference for what fields to make. Maybe I'm understanding the purpose wrong but what I'm intending to do is generate the views and controller to modify the DB. I've already created the migrations, models and the DB so I was hoping to quickly generate the CRUD forms. Is there more documentation somewhere?
What I'm getting when I use "php artisan crud:generate Product" is a page that doesn't have any fields when I click to add a product. It also generates a duplicate migration. Can you help me get this working correctly?

"composer require" this package doesn't work

composer require abmti/laravel-scaffold-generate

[InvalidArgumentException]
Could not find package abmti/laravel-scaffold-generate at any version for your minimum-stability (stable). Check th
e package spelling or your minimum-stability

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [packages1] ... [packagesN]

Routes option failing

php artisan crud:controller TemplateController --crud-name=templates --model-name=Template --route-group=admin --routes=yes --view-path="admin"

[RuntimeException]
The "--routes" option does not exist.

Also, no update on routes.php. I get this for both the crud:view and crud:controller commands.

Any ideas much appreciated, this is an awesome tool otherwise.

Boolean radio buttons

The generated boolean radio buttons look a bit weird, especially the second one.
Shouldn't booleans be handled as checkboxes? (just personal preference)

radiobuttons

Cannot Create View

hello, im using this crud. but when i try to generate. it show an error.
screen shot 2016-05-11 at 3 03 29 pm

is master.blade.php necessary?

I think master.blade.php has to go

  • Has nothing to do with CRUD
  • Adds no value to default app.blade.php
  • Doesn't load elixir
  • If I don't want to use it * I can't disable it* without modifying original in vendor folder

--namespace not available

I'm using v1.0.4 and according to the 1.0 branch there's an option for --namespace, but the CLI says this option is not available.

Not all names work well with functions str_singular / str_plural

for example in spanish plurals might end with "s" "es" "as"
to make it worse, some singulars also end with "s" like "mes" (month in spanish)

what if we add the option for the generators?

class CrudCommand extends Command
{
...
        {--singular= : singular for the crud name}
        ';

Should --view-path="admin" Be used in Routes/Redirects/etc

To say I'm "very new to Laravel" would be an understatement, but we're looking to transition from a custom thing to something like laravel. One of the things I like about our custom approach is we can generate a full CRUD process from a given DB table. Hence why I'm interested in this project.

We like to have all these admin things in /admin/ (though might not be the end of the world to let that go) and I see you have --view-path="admin" as an option. Problem is it only seems to matter for the blades (which I realize is the views).

However, if you do that, nothing seems to work until you get everything else working at /admin/widget which takes a change to the route file, any urls in the blades, and the redirects in the controller.

Am I missing something obvious, or should all those other changes be implied by --view-path="admin" as well?

Broken views and controllers when using any caps in the crud name.

You snake case the views ($viewName) and ($this->routeName) in crudCommand.php but do not use it in the stubs there for if you create a CRUD with a name like ProfilePicture it converts it to profile-picture for the view locations but they are referenced using crudName (profilepicture) in the views there for breaking the created CRUD.

I hope this makes sence to you, just try creating any CRUD with a name madeup of 2 words using capital letters for each word as in the given example above.

Pass all variables to view stub files

I'm changing around the stub files for a different layout, and it would be very useful to have all the computed variables passed (i.e. replaced) in all of the different view stub files. For example, I'd like to use %%crudNameCap%% in the create.blade.stub & show.blade.stub files. Would you consider this in a future release?

Thanks in advance...

Route groups

It would be awesome if we could add a route group for our CRUD.

For example:

php artisan crud:generate Task --viewpath="admin" --namespace="Admin" --routegroup="admin"

Expected output would be that all routes are "admin/task" instead of "task". (Just for laziness)

No commands found in the "crud" namespace

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "crud" namespace.

When I run the generator. I ran the composer require and update, and updated my app.config file with the right providers and aliases.

I also ran php artisan vendor:publish

Any ideas

Customize templates

As I requested some time ago on Laracasts, it would be nice if "php artisan vendor:publish" would publish the view/model/controller/etc. templates for further customization.

Routes option failing

php artisan crud:controller TemplateController --crud-name=templates --model-name=Template --route-group=admin** --routes=yes** --view-path="admin"

[RuntimeException]
The "--routes" option does not exist.

Also, no update on routes.php. I get this for both the crud:view and crud:controller commands.

Any ideas much appreciated, this is an awesome tool otherwise.

not found option to set my own layout

Hi,

Can you please tell me how can I give my required style to crud pages. So that I can save my time to set layout the pages. Because if I update in package files then these will remove then I run 'composer update' command.

It will very helpful if you provide me such option.
Thanks

[ErrorException] Undefined index: timestamp

hello,I use Crud command:

php artisan crud:generate Posts --fields="title:string:required,content:text:required,pubished_at:timestamp" --route=yes --pk=id --view-path="admin" --namespace=Admin --route-group=admin

But there were following errors:

Controller created successfully.
Model created successfully.
Migration created successfully.

[ErrorException]
Undefined index: timestamp

could you tell me how to solve, thank you!

Cannot create views

I've seen this issue closed on issue #81 but the x-dev and dev-master still dont work. I get the same error as in #81.

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.