全局篇

 
查看artisan命令
  1. php artisan
  2. php artisan list
 
查看某个帮助命令
  1. php artisan help make:model
 
查看laravel版本
  1. php artisan --version
 
使用 PHP 内置的开发服务器启动应用
  1. php artisan serve
 
生成一个随机的 key,并自动更新到 app/config/app.php 的 key 键值对(刚安装好需要做这一步)
  1. php artisan key:generate
 
开启Auth用户功能(开启后需要执行迁移才生效)
  1. php artisan make:auth
 
开启维护模式和关闭维护模式(显示503)
  1. php artisan down
  2. php artisan up
 
进入tinker工具
  1. php artisan tinker
 
列出所有的路由
  1. php artisan route:list
生成路由缓存以及移除缓存路由文件

  1. php artisan route:cache
  2. php artisan route:clear

功能篇

 
创建控制器
  1. php artisan make:controller StudentController
 
创建Rest风格资源控制器(带有index、create、store、edit、update、destroy、show方法)
  1. php artisan make:controller PhotoController --resource
 
创建模型
  1. php artisan make:model Student
 
创建新建表的迁移和修改表的迁移
  1. php artisan make:migration create_users_table --create=students //创建students表
  2. php artisan make:migration add_votes_to_users_table --table=students//给students表增加votes字段
 
执行迁移
  1. php artisan migrate
 
创建模型的时候同时生成新建表的迁移
  1. php artisan make:model Student -m
 
回滚上一次的迁移
  1. php artisan migrate:rollback
 
回滚所有迁移
  1. php artisan migrate:reset
 
创建填充
  1. php artisan make:seeder StudentTableSeeder
 
执行单个填充
  1. php artisan db:seed --class=StudentTableSeeder
 
执行所有填充
  1. php artisan db:seed
 
创建中间件(app/Http/Middleware 下)
  1. php artisan make:middleware Activity
 
创建队列(数据库)的表迁移(需要执行迁移才生效)
  1. php artisan queue:table
 
创建队列类(app/jobs下):
  1. php artisan make:job SendEmail
 
创建请求类(app/Http/Requests下)
  1. php artisan make:request CreateArticleRequest

---------------------

本文来自 jiandanokok 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/jiandanokok/article/details/72897682?utm_source=copy

【Laravel】 常用的artisan命令【原创】的更多相关文章

  1. laravel常用的artisan命令

    转载来源链接: https://blog.csdn.net/jiandanokok/article/details/72897682 全局篇 查看artisan命令 php artisan php a ...

  2. 【Laravel】 安装及常用的artisan命令

    composer Laravel 安装 cmd composer create-project laravel/laravel Laravel5 之后自动创建 常用的artisan命令 全局篇 查看a ...

  3. 【Laravel】 常用的artisan命令

    全局篇 查看artisan命令php artisanphp artisan list 查看某个帮助命令php artisan help make:model 查看laravel版本php artisa ...

  4. laravel 5.0 artisan 命令列表(中文简体)

    #php artisan list Laravel Framework version Usage: [options] command [arguments] Options(选项): --help ...

  5. 关于Laravel中的artisan命令

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica; color: #454545 } p.p2 { margin: 0.0p ...

  6. laravel中一些非常常用的php artisan命令

    php artisan 命令在开发laravel项目中非常常用,下面是一些总结 composer config -g repo.packagist composer https://mirrors.a ...

  7. Laravel 5.1使用命令行模式(artisan)运行php脚本

    Laravel有内置命令调度器,可以方便的实现Cron. 任务调度定义在app/Console/Kernel.php文件的schedule方法中,该方法已经包含了一个示例.Laravel里有两种方法执 ...

  8. laravel artisan 命令工具

    //全局相关 php artisan:显示详细的命令行帮助信息,同 php artisan list php artisan –help:显示帮助命令的使用格式,同 php artisan help ...

  9. laravel 常用命令

    1.创建控制器 php artisan make:controller ArticleController // 带 restful 风格 php artisan make:controller Ar ...

随机推荐

  1. Go Example--原子计数器

    package main import ( "fmt" "runtime" "sync/atomic" "time" ) ...

  2. redis源码之压缩列表ziplist

    压缩列表ziplist1.简介连续,无序的数据结构.压缩列表是 Redis 为了节约内存而开发的, 由一系列特殊编码的连续内存块组成的顺序型(sequential)数据结构. 2.组成 属性 类型 长 ...

  3. this关键字的使用8/22

    实质就是:this代表当前对象目录: 1.this(name) 调用同一个类中参数为 public Person(String name)这个构造方法 2.this.say() 同一个类中,某一个方法 ...

  4. golang-build-error

    工程中同时有两个main文件,编译的时候提示: go build proxy/proxy.go pb/anti_spam.pb.go::: cannot find package "_/Us ...

  5. Centos7安装32位库用来安装32位软件程序

    打算在centos7上安装一个远程控制软件,发现teamviewer只有centos的32位版本,试着安装了一下,各种报错,尝试多次无果.于是试着用向日葵远程控制软件,也报错,貌似也是只支持32位. ...

  6. nginx启动重启与升级以及检测配置文件

    查看nginx的主进程号 ps -ef|grep nginx 从容停止nginx kill - QUIT nginx主进程号 或者 kill - QUIT nginx的pid文件所在,例如我的 [ro ...

  7. GitLab Shell如何通过SSH工作

    转自:https://wayjam.me/post/how-gitlab-shell-works-with-ssh.md GitLab访问Git仓库 首先回顾GitLab的Git仓库四种访问方式: g ...

  8. oracle-sql内置函数

    函数  oracle 自定义函数入门 主题:ORACLE函数大全 ############################### set operators UNION, UNION ALL, INT ...

  9. CSS背景渐变支持transition过渡效果

    background-image 是不支持 CSS3 的transition过渡效果的,而CSS3 gradient 渐变作为背景图片存在的时候, 下面的CSS不会有过渡效果 <div clas ...

  10. 短小而精悍的JsvaScript函数

    1. 回到顶部, 使用浏览器的刷新频率 requestAnimationFrame 来实现的 const scrollToTop = () => { const c = document.doc ...