This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello,
I modified rainlab.blog system and now it's contain it's own unique name and database tables and etc. but I don't know how should install it now and didn't found any docs about it.
anyone know how I should install developed plugin?
You shouldn't modify plugin files, instead write your own plugin to extend the blog. This way your changes won't be lost when the blog plugin is updated.
To install / refresh your new plugin, use the command php artisan plugin:refresh YourAuthorName.YourPluginName
Hi Again,
I created migration tables and models with create:model command. after it using create:controller i created controlles. and config Plugin.php files. everythings ok and my plugin accessible through backend. but I have a problem, migration section will not create any table!
You need to add your migrations to updates/version.yaml
for them to run. For example:
1.0.0:
- First version of my funky plugin
- name_of_first_migration.php
- name_of_second_migration.php
Did you add your migration file to updates/version.yaml
? Without doing this, your migrations will not run.
Edit Well played Dave, you beat me by 39 seconds lol
Last updated
Scott said:
Edit Well played Dave, you beat me by 39 seconds lol
What can I say? I'm a wizard ;)
I found solultion. after run "php artisan plugin:refresh" we should sign-out from backend and sign-in again. before it I added migration php file names to version.yml (thanks scott and wizad ;) )
my next question: is it possible we extend model with cli? i know how to make mode "php artisan create:model pluging-name model-name" but how can we extend it and add table rows and etc. are there any solution or we should using IDE?
Last updated
Check the docs for extending models - you'd put that in your Plugin.php@boot()
method. See the example here.
Hi Guys,
before everythings I want to say thanks for your helps. Actually all replies are so useful for me.
I have another problem know. each time I used "artisan plugin:refresh" all records deleted. are there any solution to prevent deleting records?
for example when i change a column from string to text or tinyInteger to Integer it should not be remove all records! getting backup and restore each time will loss many time for each refresh!
Refresh will always reset all migrations. If you want to keep your data during development, you need to use a seeder.
As far as renaming columns or changing field types, you'll want to use something like $table->string('field_name')->change();
, which will tell Laravel's Schema Builder that you want to change an existing field rather than dropping one and creating it fresh. This is more for when you update the plugin, though: during development you'll just edit the existing migration.
There's plenty more info on all of this and more in the database structure docs. The Laravel documentation for schema builder and migrations have even more info on the technical side of things, which I'd recommend you read in full. Between Laravel and October, the docs should answer every question you might have.
I have created a plugin but when i use it in another website,it is necessary for user to run "php artisan october:up".if user does not run the command, than table does not get created and give error base table does not found
I have created a plugin but when i use it in another website,it is necessary for user to run "php artisan october:up".if user does not run the command, than table does not get created and give error base table does not found
1-15 of 15