zoukankan      html  css  js  c++  java
  • laravel常用命令

    artisan是 laravel 提供的 命令行接口,这里记录下常用的命令

    常用命令

    php artisan --version   查看版本
    php artisan list // 查看所有可用的 Artisan 命令。
    php artisan route:list //查看已添加的路由
    php artisan key:generate	//生成 App Key
    php artisan tinker   // 进入命令模式
    

    创建命令

    php artisan make:controller	[名称] // 生成控制器
    php artisan make:model	[名称] // 生成模型
    php artisan make:policy [名称] // 生成授权策略类文件
    php artisan make:notification [名称] //生成 (app/Notifications/[名称].php 文件)
    

    清除命令

    php artisan config:cache //缓存配置
    php artisan route:cache  //缓存路由
    php artisan cache:clear  //清除应用缓存
    php artisan route:clear  //清除路由缓存
    php artisan config:clear //清除配置缓存
    php artisan view:clear   //清除编译的视图层
    

    数据库操作

    php artisan make:migration add_is_admin_to_users_table --table=users // 生成指定数据表的迁移文件 (/database/migrations下的文件)
    php artisan migrate  // 执行所有未被执行过的数据迁移 (up 方法会被调用)(即/database/migrations下的文件)
    php artisan migrate:refresh  // 重置数据库并重新运行所有迁移
    php artisan migrate:rollback //回滚执行成功后,两个表都将被删除。(down 方法会被调用)
    php artisan migrate:rollback --step=1 //回滚数据迁移一步
    
    php artisan make:seeder [名称] // 生成数据自动填充类文件(/database/migrations/seeds/[名称].php 文件)
    php artisan db:seed			  // 自动填充数据(默认所有填充类)
    php artisan db:seed --class=UsersTableSeeder // 指定自动填充数据
    php artisan migrate:refresh --seed // 重置数据,并自动填充数据
    
  • 相关阅读:
    [HDU1087]Super Jumping! Jumping! Jumping!<dp>
    [codeforces]Page Numbers <模拟>
    [POJ1190]生日蛋糕<DFS>
    [HDU1029]Ignatius and the Princess IV<桶 水题>
    矩阵优化
    康复式训练
    bzoj1036 [ZJOI2008]树的统计Count
    luogu3761 [TJOI2017]城市
    bzoj2282 [SDOI2011]消防
    NOI2014
  • 原文地址:https://www.cnblogs.com/xuduan/p/14673018.html
Copyright © 2011-2022 走看看