sohelamin / crud-generator Goto Github PK
View Code? Open in Web Editor NEWLaravel CRUD Generator
Home Page: https://packagist.org/packages/appzcoder/crud-generator
License: MIT License
Laravel CRUD Generator
Home Page: https://packagist.org/packages/appzcoder/crud-generator
License: MIT License
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.
Is it possible to generate after i have created a migration table?
Hey,
it's a dumb question, but what does "SL." stand for?
Thank you :)
It's possible to change from url() to route() in stubs?
I got problem when add prefix to route group.
how can I upload new file via admin?
Hi can you add option for grouping all views in one folder eg. /admin or /panel ?
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.
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
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
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
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?
When i create new data, it created twice.
am i missing something?
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.
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 ?
Nice package, thanks!
Though, when implementing on fresh Laravel 5 app, it throws Class 'Form' not found error.
In case someone is confused, you need just to add illuminate/html package. Here are more details: http://laravel.io/forum/09-20-2014-html-form-class-not-found-in-laravel-5
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.
Hi Sohel,
As the first I liked your Scaffold App.
Will crud-generator supports 'Enum' field type?
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)
Hi,
Not sure if this is the right place to ask, but I couldn't find a better alternative.
I'm a Laravel newbie, and found these 2 similar tools:
https://github.com/laracasts/Laravel-5-Generators-Extended
https://github.com/appzcoder/crud-generator
Are they different? Complementary?
Many thanks in advance, and sorry if my question is innappropriate.
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!
Hi,
Nice script, thanks a lot.
It would be nice to be able to customize the %%formFieldsHtml%% part as well
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
Probably it would be good to add some tests to assure that nothing breaks in the next releases
when I'm using:
php artisan crud:model Person --fillable="['name', 'email', 'message']"
I see error:
[RuntimeException] The "--fillable" option does not accept a value.
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 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]
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.
if not, shouldn't it be
composer require appzcoder/crud-generator --dev
in the readme ?
Could you please update to support Laravel 5.2?
I think master.blade.php has to go
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.
When I ran command:- composer require appzcoder/crud-generator
I got following error.
The "http://packagist.org/p/provider-2013%248fdf62067f4932e57f307bef5e48580c504f74fa044a7ddac59e496d065deb5e.json" file could not be downloaded (HTTP/1.1 400 Bad Request)
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Please let me know.
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}
';
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?
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.
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...
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)
Is possible to generate crud with relationships?
[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
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.
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.
Is possible to make some field required?
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
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.