您现在的位置是:首页 > 文章详情

laravel日常操作

日期:2018-05-03点击:778

1、创建user表

php artisan make:migration create_users_table --create=users

2、创建控制器(同时创建model)

php artisan make:controller PhotoController --resource --model=Photo

3、创建model

php artisan make:model Models/Article

4、数据迁移

php artisan migrate

5、生成普通控制器

php artisan make:controller PostController 

6、使用RESTFUL生成控制器(自动生成index、create、store、show、edit、update、destory方法)

php artisan make:controller PostController --resource

6、默认时间写法

$table->timestamp('time')->default(\DB::raw('CURRENT_TIMESTAMP'));  

7、初始化路径

 php72 artisan make:auth

7、生成key

php72 artisan key:generate

8、Generated passport keys

php72 artisan passport:install

8、laravel-admin生成后台表以及数据

php artisan admin:install

9、队列操作

php72 artisan queue:restart
php72 artisan synclast

10、单独开启队列,一般测试服用

php72 /home/test/artisan queue:work --queue=hightest --tries=1 --timeout=24

10、查看当前有那些队列

ps -ef|grep php72

11、修改权限

chown -R apache:apache 目录
原文链接:https://yq.aliyun.com/articles/634835
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章