php artisan --version-- check laravel version
php artisan serve -- to start laravel
php artisan route:list -- to show all the routes as defined in web.php
php artisan make:controller TestController -- to make new controller
php artisan make:controller MovieController --resource -> use command to make new controller with all crud operations in it
php artisan make:migration create_books_table --create=books --> to create new table file in database/migrate folder
php artisan migrate --> to create tables in database of created files in migrate folder
php artisan help make:migration --> to check all commands in maigration
php artisan migrate:refresh --> Reset and re-run all migrations
php artisan tinker ==> to use php in CMD
[{
DB::table("companies")->insert(["name"=>"hello company","email"=>"email@gmail.com","location"=>"abc","created_at"=>new DateTime])
DB::table("companies")->get()
DB::table("companies")->where(["name" => "param"])->first()
DB::table("companies")->pluck("col_name")->get
EXAMPLE:-:>> DB::table("companies")->pluck("name")->get
-> this will show all the data from column name only
DB::table("companies")->select("name","email")->get()
DB::table("companies")->order("id","desc")->get()
DB::table("companies")->where("id","2")->update(["key"=>"value"])
DB::table("companies")->where("id","2")->delete()
}]
php artisan make:model post -mc ----->to create model as well as table of same name
php artisan make:request MyForm ----->it will create requests folder in Http folder and also create myform.php file in at
php artisan storage:link Create a symbolic link from "public/storage" to "storage/app/public"
php artisan route:list -- to show all the routes as defined in web.php
php artisan make:controller TestController -- to make new controller
php artisan make:controller MovieController --resource -> use command to make new controller with all crud operations in it
php artisan make:migration create_books_table --create=books --> to create new table file in database/migrate folder
php artisan migrate --> to create tables in database of created files in migrate folder
php artisan help make:migration --> to check all commands in maigration
php artisan migrate:refresh --> Reset and re-run all migrations
php artisan tinker ==> to use php in CMD
[{
DB::table("companies")->insert(["name"=>"hello company","email"=>"email@gmail.com","location"=>"abc","created_at"=>new DateTime])
DB::table("companies")->get()
DB::table("companies")->where(["name" => "param"])->first()
DB::table("companies")->pluck("col_name")->get
EXAMPLE:-:>> DB::table("companies")->pluck("name")->get
-> this will show all the data from column name only
DB::table("companies")->select("name","email")->get()
DB::table("companies")->order("id","desc")->get()
DB::table("companies")->where("id","2")->update(["key"=>"value"])
DB::table("companies")->where("id","2")->delete()
}]
php artisan make:model post -mc ----->to create model as well as table of same name
php artisan make:request MyForm ----->it will create requests folder in Http folder and also create myform.php file in at
php artisan storage:link Create a symbolic link from "public/storage" to "storage/app/public"
Comments
Post a Comment