OctoberCMS Migrate Table - php

I am very new to octobercms and I have experience in using laravel 4.2 .
I wanna ask how to create a table using artisan in cmd? Or is it in octobercms does not need to use cmd to create table? Any link with details tutorial to share?
Thank you.

First, you need to create a plugin : php artisan create:plugin MyCompagny.MyPlugin
Then, you can create a model (table) : php artisan create:model MyCompagny.MyPlugin Nameofthemodel
Then you can edit the migration file to fit your need, and run php artisan plugin:refresh MyCompagny.MyPlugin
Note that OctoberCMS is based on Laravel 5.0
That's it! Hope its help

Though the above answer is correct, another solution for creating tables would be using Rainlab.Builder plugin, which has its own user interface to easily create tables, Models, Controllers and many more )

Related

laravel artisan tool to generate mvc structure

I used cakephp before and it comes with bake command tool that generate full MVC skeleton with complete crud functions.
Cakephp's bake console just need database to read and it automatically generate the code with command:
bake all --everything
I want to know dose atrisan have the same tool or not? And if so how can I do that?
Should I install third party packages to achieve this or Laravel artisan support by default?
I prefer laravel default tooling if its available.
Thanks in advance.
I don' think there is a built in command like bake all in laravel. However this library seems to do what you are asking for
You can use artisan to create individual MVC components. Perhaps you could collect these in a shell script and run them all at the same time
Creating a controller
This will also generate the crud functions
php artisan make:controller ControllerName
Creating a model
php artisan make:model ModelName

Creating a mysql view using php artisan for migration?

How do you create a mysql view using php artisan? Can't find any documentation on it???
Google and Bing aren't returning much at all!
documentation for Laravel: http://laravel.com/docs/migrations
Your question is a little unclear. It seems you may not understand the difference between Views, Migrations and MySQL Tables.
Migrations can be created with Artisan via php artisan make:migration ... or manually. They contain code that create MySQL Tables.
Views are template files that display a page for end users to interact with. In Laravel, Views are Blade Templates.
Artisan does not offer a command for creating Views. But there are Composer packages you can install that will extend Artisan with such functionality.
https://github.com/bencomeau/artisan-make-view
https://github.com/svenluijten/artisan-view

Laravel, it's possible work with migrations on existing database?

I'm building my first application using Laravel 4 but before know the migrations.
I created a database for that and I want to know if it's possible works migrations with my database.
Regards!
Yes, it's possible. Laravel online migration file generator made the task easy. Just enter your existing table schema and get Laravel migration file.
Try: https://laravelarticle.com/laravel-migration-generator-online

CakePHP adding tables to ACL controlled application

Sorry if this is a noob question, I'm using the Simple ACL Controlled Application tutorial as a boilerplate and need to add (bake) a few more tables. If I create a new table then run "cake bake all" from the console, how would I go about updating the ACL as well, I believe I should only need to update the acos table, could be wrong? Is there a command I should use after the new models, views and controllers are generated?
Thanks in advance!
EDIT : I'm using the AclExtras plugin to to input all of my controllers and actions into the Acl.
To sync up your ACO using AclExtras, you would run something like this at the command line:
php "/cake/lib/Cake/Console/cake.php" AclExtras.AclExtras aco_sync

Workflow migrations phalcon

Time ago I worked with yii framework.
In yii framework with yiic shell I make migration file and write actions for db: create table, alter table, create index and any actions with another (no db).
But in phalcon I don't see this. Yeah, I know about migrations, but what is it?
I make migration for my db with one table;
If I have empty db and use "phalcon migration run" then I have "table %name_table% don't exists"
And how I can use this for normal migrations?
And where phalcon save information about used migrations? Or every time start from 1.0.0 migration?
If you are using DevTools 3.1.2, run the following command to learn more about migration options in Phalcon 3
phalcon migration --help
Hope it helps
I think you need to dump one first - phalcon gen-migration
Try reading the full page and watching the tutorial video for them - http://docs.phalconphp.com/en/latest/reference/migrations.html

Categories