Creating a mysql view using php artisan for migration? - php

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

Related

is php artisan make::controller required for Laravel development?

I'm starting out learning Laravel, and all the tutorials show how to use
php artisan make:controller BlahController
to make a new controller.
Is there a requirement I do this from the command line? If I want to do it by hand, what would I need to do to replicate that action?
I know that of course, I'd need to manually create the BlahController.php file inside the app\http\Controllers folder.
But does artisan make:controller alter/create any other files?
Broader question. Is php artisan required at all to work in Laravel? Or can all development be done by hand coding?
No, it is not required at all to use php artisan to create any files.
The purpose of artisan is to make your work more automated or less coding in general, but you are 100% correct, you can just manually create the controller file on its own (or model or view or anything related to laravel) without using artisan.
Example of artisan is to do things like:
php artisan create:model MyModel -all
This will create:
migration
seeder
factory
policy
resource controller
form request classes for the model
all of that is created and ready to be edited in a single command rather than having to manually create each file and filling it up and checking if the names are correct etc...
You can do so many things with artisan to simplify the process, and you can always read more on what options you have when creating things by doing:
php artisan create:controller -help
More of the documentation can be found here: https://laravel.com/docs/9.x/artisan#introduction
Laravel artisan helps you to do things faster
Ofcourse you can create it manually but artisan makes your life a little bit easier!
I highly recommend it
Also It's not about just creating a controller
It does a lot, read more about it here:
https://laravel.com/docs/9.x/artisan

Laravel Multiple Migration Table in one Statement

I am new to Laravel and I'm confused if it is possible to create a multiple migration table in Laravel in just one run?
Like:
php artisan make:migration user_acc_tbl --create=user_acc_tbl, user_info_tbl --create=user_info_tbl, skills_tbl --create=skills_tbl
I hope it is possible. So that we can just run the command once from the command terminal to create multiple migration files. It would be really helpful though.
According to the Laravel documentation, it is not possible to make multiple migrations in one command line. You may be able to write a custom artisan console command and do it that way, however I really don't see how it would save that much time.
What you could do is create multiple tables from one migration file. Just use Schema::create and create the proper tables with the necessary columns.
You could also create aliases to help speed up workflow in the terminal.

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

OctoberCMS Migrate Table

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 )

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