php artisan 命令是Laravel框架自带的命令,方便用户快速创建、查看对应的模块参数等。

一、常用的命令:

php artisan list                             查看php artisan所有命令

php artisan --help                        查看php artisan的用法

php artisan help admin:make      查看php artisan admin:make的用法

php artisan admin:make --help   查看php artisan admin:make的用法

创建控制器

php artisan make:controller OrderController

创建Rest风格资源控制器(带有index、create、store、edit、update、destroy、show方法)

php artisan make:controller OrderController--resource

创建模型

php artisan make:model Student

创建新建表的迁移和修改表的迁移

php artisan make:migration create_orders_table --create=orders //创建订单表orders

php artisan make:migration add_tags_to_orders_table --table=orders//给orders表增加tags字段

执行迁移

php artisan migrate

创建模型的时候同时生成新建表的迁移+控制器+路由

php artisan make:model Order-m -c -r

回滚上一次的迁移

php artisan migrate:rollback

回滚所有迁移

php artisan migrate:reset

创建填充

php artisan make:seeder OrderTableSeeder

执行单个填充

php artisan db:seed --class=OrderTableSeeder

执行所有填充

php artisan db:seed

创建中间件(app/Http/Middleware 下)

php artisan make:middleware Activity

创建队列(数据库)的表迁移(需要执行迁移才生效)

php artisan queue:table

创建队列类(app/jobs下):

php artisan make:job SendEmail

创建请求类(app/Http/Requests下)

php artisan make:request CreateArticleRequest

二、通常一个laravel项目的后台管理系统搭建流程,如下

1、下载Laravel框架,安装Laravel-admin后台管理框架,进行基础的数据库连接配置,上传配置,https/http访问方式等

2、Linux服务器下面,进入项目的根目录,可以用php artisan make命令创建模型+数据迁移+控制器。

3、用php artisan admin:make 创建后台的控制器,可以写脚本批量创建。之后根据业务逻辑,编写控制器内容。

4、为后台的控制器创建对于的路由,可以写脚本批量创建。

5、登录Laravel-admin后台系统,设置对应的菜单。

三、Laravel Artisan 命令大全

Available commands:

命令中文English

clear-compiled

删除已编译的类文件

Remove the compiled class file

down

将应用程序置于维护模式

Put the application into maintenance mode

dump-server

启动转储服务器以收集转储信息。

Start the dump server to collect dump information.

env

显示当前的框架环境

Display the current framework environment

help

显示命令的帮助

Displays help for a command

inspire

---

Display an inspiring quote

list

列出命令

Lists commands

migrate

运行数据库迁移

Run the database migrations

optimize

缓存框架引导程序文件

Cache the framework bootstrap files

preset

为应用程序交换前端脚手架

Swap the front-end scaffolding for the application

serve

在 PHP 开发服务器上提供应用程序

Serve the application on the PHP development server

tinker

与您的应用程序互动

Interact with your application

up

使应用程序退出维护模式

Bring the application out of maintenance mode

app

命令中文English

app:name

设置应用程序命名空间

Set the application namespace

auth

命令中文English

auth:clear-resets

刷新过期的密码重置令牌

Flush expired password reset tokens

cache

命令中文English

cache:clear

刷新应用程序缓存

Flush the application cache

cache:forget

从缓存中删除项目

Remove an item from the cache

cache:table

为缓存数据库表创建迁移

Create a migration for the cache database table

config

命令中文English

config:cache

创建缓存文件以加快配置速度

Create a cache file for faster configuration loading

config:clear

删除配置缓存文件

Remove the configuration cache file

db

命令中文English

db:seed

填充数据库

Seed the database with records

event

命令中文English

event:generate

根据注册生成缺少的事件和侦听器

Generate the missing events and listeners based on registration

key

命令中文English

key:generate

生成应用程序 key

Set the application key

lang

命令中文English

lang:publish

将语言文件发布到资源目录

publish language files to resources directory.

make

命令中文English

make:auth

---

Scaffold basic login and registration views and routes

make:channel

创建一个新的 channel 类

Create a new channel class

make:command

创建一个新的 Artisan 命令

Create a new Artisan command

make:controller

创建一个新的控制器类

Create a new controller class

make:event

---

创建一个新的 event 类

make:exception

创建一个新的自定义异常类

Create a new custom exception class

make:factory

创建一个新的模型工厂

Create a new model factory

make:job

创建一个新的工作类

Create a new job class

make:listener

创建一个新的事件监听器类

Create a new event listener class

make:mail

创建一个新的电子邮件类

Create a new email class

make:middleware

创建一个新的中间件类

Create a new middleware class

make:migration

创建一个新的迁移文件

Create a new migration file

make:model

创建一个新的 Eloquent 模型类

Create a new Eloquent model class

make:notification

创建一个新的通知类

Create a new notification class

make:observer

创建一个新的观察者类

Create a new observer class

make:policy

创建一个新的策略类

Create a new policy class

make:provider

创建一个新的服务提供者类

Create a new service provider class

make:request

创建一个新的表单请求类

Create a new form request class

make:resource

创建一个新资源

Create a new resource

make:rule

创建新的验证规则

Create a new validation rule

make:scaffold

代码生成器 — Laravel 5.x Scaffold Generator

Create a laralib scaffold

make:seeder

创建一个新的 seeder 类

Create a new seeder class

make:test

创建一个新的测试类

Create a new test class

migrate

命令中文English

migrate:fresh

删除所有表并重新运行所有迁移

Drop all tables and re-run all migrations

migrate:install

创建迁移存储库

Create the migration repository

migrate:refresh

重置并重新运行所有迁移

Reset and re-run all migrations

migrate:reset

回滚所有数据库迁移

Rollback all database migrations

migrate:rollback

回滚上次数据库迁移

Rollback the last database migration

migrate:status

显示每次迁移的状态

Show the status of each migration

notifications

命令中文English

notifications:table

为通知表创建迁移

Create a migration for the notifications table

optimize

命令中文English

optimize:clear

删除缓存的引导程序文件

Remove the cached bootstrap files

package

命令中文English

package:discover

重建缓存的包清单

Rebuild the cached package manifest

queue

命令中文English

queue:failed

列出所有 failed 队列工作

List all of the failed queue jobs

queue:failed-table

为 failed 队列工作数据库表创建迁移

Create a migration for the failed queue jobs database table

queue:flush

刷新所有 failed 队列工作

Flush all of the failed queue jobs

queue:forget

删除 failed 队列工作

Delete a failed queue job

queue:listen

监听一个给定的队列

Listen to a given queue

queue:restart

在当前工作之后重新启动队列工作器守护程序

Restart queue worker daemons after their current job

queue:retry

重试 failed 队列作业

Retry a failed queue job

queue:table

为队列工作数据库表创建迁移

Create a migration for the queue jobs database table

queue:work

开始将队列上的工作作为守护程序处理

Start processing jobs on the queue as a daemon

route

命令中文English

route:cache

创建路由缓存文件以加快路由注册速度

Create a route cache file for faster route registration

route:clear

删除路由缓存文件

Remove the route cache file

route:list

列出所有注册的路由

List all registered routes

schedule

命令中文English

schedule:run

运行预定的命令

Run the scheduled commands

session

命令中文English

session:table

为会话数据库表创建迁移

Create a migration for the session database table

storage

命令中文English

storage:link

创建从 “公共 / 存储” 到 “存储 / 应用 / 公共” 的符号链接

Create a symbolic link from "public/storage" to "storage/app/public"

vendor

命令中文English

vendor:publish

从供应商包中发布任何可发布的资产

Publish any publishable assets from vendor packages

view

命令中文English

view:cache

编译所有应用程序的 Blade 模板

Compile all of the application‘s Blade templates

view:clear

清除所有编译的视图文件

Clear all compiled view files

原文:https://www.cnblogs.com/myzan/p/12000857.html

php artisan migrate,Laravel php artisan 自动生成Model+Migrate+Controller 命令大全相关推荐

  1. 懒人小工具1:winform自动生成Model,Insert,Select,Delete以及导出Excel的方法

       懒人小工具2:T4自动生成Model,Insert,Select,Delete以及导出Excel的方法    github地址:https://github.com/Jimmey-Jiang/J ...

  2. 简单的hibernate环境搭建、自动生成model/配置/hibernate.xml配置文件

    自己亲测的东西才是最有效果的,下面贴出整个编写的过程. 1 hibernate环境搭建,这个博客非常给力:http://www.111cn.net/wy/js-ajax/93142.htm 需要用到的 ...

  3. 基于OCILIB的oracle数据库操作总结及自动生成Model和Dao的工具

    基于OCILIB的oracle数据库操作总结 1.       类图 2.       基类BaseOCIDao的设计与实现 BaseOCIDao.h头文件 #pragma once/* ------ ...

  4. Dataset之图片数据增强:设计自动生成(高级封装之命令行解析实现)汽车车牌图片算法(cv2+PIL+argparse)根据随机指定七个字符自动生成逼真车牌图片数据集(带各种噪声效果)

    Dataset之图片数据增强:设计自动生成(高级封装之命令行解析实现)汽车车牌图片算法(cv2+PIL+argparse)根据随机指定七个字符自动生成逼真车牌图片数据集(带各种噪声效果) 导读 设计自 ...

  5. iOS_Spring自动生成Model,Service,Controller 之 介绍

    下载iOS_Spring_Source 使用教程   视频教程 不吹牛,别人一个星期完成的工作,我一个上午就做完了.而且做的很好,更开心.不全是因为iOS_Spring,但是iOS_Spring有着非 ...

  6. 使用mybatis-generator自动生成model、dao、mapping文件

    参考文献:http://www.cnblogs.com/smileberry/p/4145872.html 一.所需库 1.mybatis-generator库 2.连接DB的驱动(此以mysql为例 ...

  7. mybaitis快速生成_Mybatis中使用mybatis-generator结合Ant脚本快速自动生成Model、Mapper等文件...

    使用过Mybatis的同学都知道,针对每一个项目中使用到的数据库表都需要建立其对应的数据库增删改查xxxMapper.xml文件.实体类xxx.java文件以及其他类用来调用进行数据库操作的xxxMa ...

  8. flutter - built_value 自动生成model

    使用built_value自动生成 google 团队内开发 flutter 必备工具 我们拥有的或者说接口返回的数据,通常是一个json格式的字符串, 这里用response指代此数据,其包含id ...

  9. 通过python自动生成curl的调用命令

    一.前言 有的时候我们需要在Linux里面执行Curl命令,但是Curl命令里面牵涉到单引号或者双引号,转移字符,有的时候可能差之毫厘谬以千里,这个时候,有没有什么好的方法能够自动生成curl命令的呢 ...

最新文章

  1. mysql如何根据业务分表设计_mysql分表分库的应用场景和设计方式
  2. java loadonstartup_java的web配置文件的“load-on-startup0/load-on-startup”一个问题
  3. php怎么使得字体滚动,滚动文字+字体特效代码(全集)
  4. 超干货!为了让你彻底弄懂 MySQL 事务日志,我通宵搞出了这份图解!
  5. 解决UnicodeEncodeError。python的docker镜像增加locale 中文支持
  6. win7 Ftp搭建
  7. FFplay源码分析-EOF
  8. python设置excel单元格格式_Python帮你做Excel——格式设置与画图
  9. 简单的前端文件预览下载功能
  10. 控制手柄分体式滑环在船用起重机中的运用
  11. 【简单易上手】昇思MindSpore邀你定制专属Diffusion模型
  12. 关于游戏开发,如何开发一款游戏(基于unity)
  13. 统计学笔记——统计基础(协方差,相关系数,决定系数)
  14. 如何提取abaqus的位移和其坐标
  15. 帮助计算机网络犯罪活动罪司法解释,帮助信息网络犯罪活动罪司法适用研究
  16. WWW和WAP的信息流程有什么区别
  17. php lcg_value与mt_rand生成0~1随机小数的效果比较
  18. [redis]Connection failure occurred. Restarting subscription task after 5000 ms
  19. ibmt60驱动安装
  20. PAT(乙级)1110 区块反转(JAVA)

热门文章

  1. maven+ssm+redis配置demo
  2. CSS3 使用 calc() 计算高度 vh px
  3. 什么是半波整流器?半波整流器的使用方法
  4. Hutool - 信息脱敏工具 - DesensitizedUtil
  5. 【sj借鉴】NP-hard
  6. 百题突击12:1,SVM算法的优缺点 2,SVM的超参数C如何调节 3,SVM的核函数如何选择 4,简述SVM硬间隔推导过程 5,简述SVM软间隔推导过程
  7. Linux操作系统安装及服务控制
  8. UE4 蓝图学习 FlipFlop
  9. 学计算机改变命运?有意思的考研调剂宣传
  10. DKIM、DMARC 和 SPF:设置电子邮件安全