laravel:artisan的常用命令(10.27.0)
一,列出所有命令
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan list
二,显示命令的帮助信息:
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan help serve
Description:
Serve the application on the PHP development server
Usage:
serve [options]
…
三,用 PHP 内置的开发服务器为应用程序提供服务
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan serve
四,列出所有的路由:
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan route:list
五,创建控制器/controller
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan make:controller NewsController
INFO Controller [app/Http/Controllers/NewsController.php] created successfully.
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/10/16/laravel-artisan-de-chang-yong-ming-ling-10-27/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
六,创建模型/model
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan make:model News
INFO Model [app/Models/News.php] created successfully.
查看创建生成的php文件:
liuhongdi@lhdpc:/data/laravel/dignews$ ls app/Http/Controllers/NewsController.php
app/Http/Controllers/NewsController.php
liuhongdi@lhdpc:/data/laravel/dignews$ ls app/Models/News.php
app/Models/News.php
七,查看当前laravel框架的版本:
liuhongdi@lhdpc:/data/laravel/dignews$ php artisan --version
Laravel Framework 10.27.0