I must add table to existing octobercms project and added migration but it is not migrating. what may be problem? when I type php artisan october:migrate I faced with this problem
Command "october:migrate" is not defined.
Did you mean one of these?
october:down
october:env
october:fresh
october:install
october:mirror
october:passwd
october:up
october:update
october:util
php artisan october:up will only migrate the database
php artisan october:update will update the application files, plugins and migrate the database.
Check out this thread on the official forum
https://octobercms.com/forum/post/artisan-migrate
I had a similar issue: https://github.com/octobercms/october/issues/5589
It looks like the october:migrate would be available once you updated to the version 2.
It is a paid one.
Related
Laravel z-song Admin
after the composer update, this error appeared and not one type of grid wants to render
Try to run artisan view:clear and if it doesn't work then remove $grid->showTools()
or change $grid->build('Build'); to $grid->column('build');
good luck
I'm trying to do a rollback in Laravel 5.4. I deleted a file manually from the migrations folder. Now when I try to rollback I get an error:
[root#xxx]# php artisan migrate:rollback
[ErrorException]
Undefined index: 2017_08_22_204640_create_tasks_table
That file was a test (with a controller and a view), but I'm new on Laravel and didn't know that deleting that file manually would be a problem.
How can repair that now?
Edit: The main goal is to rename a column from a table made with migrations.
I made this migration file:
[root#xxx]# php artisan make:migration rename_nombre_generadora_column --table="admin_generadora" --create
Created Migration: 2017_08_24_160600_rename_nombre_generadora_column
But then I saw that the name of the table was wrong, should be admin_generadoras. I wanted to create a new migration file but I got this error:
[root#xxx]# php artisan make:migration rename_nombre_generadora_column --table="admin_generadoras" --create
[InvalidArgumentException]
A RenameNombreGeneradoraColumn migration already exists.
So how can I undo that migration?
In situations like this I always tend to simply delete whole database and run "correct" migrations again. You have seeds right? You have factories right?
I copy some text I have written before:
Note for migrations and how to do it right (IMHO):
always use migrations to create and update database schema
if you are a lone developer AND there is no production environment set up, just amend the migrations and do database reset (remove all tables) + migrate
if you are a team OR there is production environment already set up, always create new migration
do not bother with down() method that much
Some material from creator & friends of Laravel regarding migrations can be heard in this podcast http://www.laravelpodcast.com/episodes/68236-episode-53-bigger-better around 30 minute mark.
What you need to do now is to understand deeply how migrations work! To do that you need to take a look at migrations table and play with it; play with artisan and migrations related commands. And remember you can update/amend database schema with SQL (that means using some kind of database client like PhpMyAdmin) but also amend/update corresponding migration.
the --table flag just helps you fill out the migration file faster. Just go in to the RenameNombreGeneradoraColumn file and change admin_generadora to admin_generadoras
I'm trying to use a service class in Laravel called ide-helper. It provides auto completion into PHPStorm. it is not functioning as expected. I have been advised that I should run php artisan clear-compiled.
what does the term "clear compiled" mean ?
https://github.com/barryvdh/laravel-ide-helper#automatic-phpdoc-generation-for-laravel-facades
Many thanks
Laravel uses an optimized class loader for better performance.
The command php artisan clear-compiled deletes the following 2 files:
bootstrap/compiled.php Created when you optimize classes.
app/storage/meta/services.json This file is created as Laravel tries to optimize the loading of the service providers your application uses.
For more Information on performance optimizing also see http://laravel-recipes.com/recipes/60/optimizing-the-framework-for-better-performance
I installed CalendarBundle - jQuery fullcalendar by following the tutorial on this link: https://github.com/adesigns/calendar-bundle and I succeeded to display the calendar. But the problem is that I can't add events by clicking on the calendar despite I added an Event Listener class by following this part of the tutorial: https://github.com/adesigns/calendar-bundle#adding-events. In addition I don't know how to deal with database using the bundle I installed.
So, what shall I do exactly??
Thanks in advance.
I've never tried to install this bundle before, the following may work & may not, may even not working with doctrine but it worth testing:
Try to generate a new bundle
php app/console generate:bundle
Then generate entities you need (in the tutorial you posted they say there is Entity/EventEntity class, so
php app/console doctrine:generate:entity
Then create your data base
php app/console doctrine:database:create
(try to follow entity description in that documentation to know what are the fields that must be inserted)
Now update everything:
php app/console doctrine:schema:update --dump-sql
and
php app/console doctrine:schema:update --force
Tell me if it works or not.
Has the php artisan key:generate command been removed in Laravel 4?
Running it returns;
[InvalidArgumentException]
There are no commands defined in the "key" namespace.
How should you generate keys now? Or do you need to create one manually?
At the time the question was asked, this feature had not yet been implemented for Laravel. It has now.
This is one of the dangers of asking questions about software that's not yet been released. The answers will change.