php Laravel-admin Nginx -Socket

composer

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

如果需要取消全局配置,执行以下命令即可

composer config -g --unset repos.packagist

开始一个laravel-admin项目

第一步:https://learnku.com/docs/laravel/5.7/installation/2242 创建laravel项目
第二步:https://pkg.phpcomposer.com 安装laravel-admin模块
官方文档 :https://laravel-admin.org/docs/zh/1.x

第三步:https://blog.csdn.net/dmguying/article/details/87745283 按照这个教程操作

开始创建控制器

// 创建Model  成功后,会有 migrations 文件生成
php artisan make:model --migration Movies 

// 在migrations 里面添加表的字段,然后运行会生成 sql 表
php artisan migrate

// 创建 控制器
php artisan admin:make MoviesController --model='App\Models\Movies'

在Laravel中开发 Vue 页面

看这个链接:
https://segmentfault.com/a/1190000020457104
注意要安装 vue 等一些东西,注意版本一致。参考下面的配置

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19",
        "cross-env": "^7.0",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.19",
        "resolve-url-loader": "^3.1.0",
        "vue-template-compiler": "^2.6.12",
        "babel-plugin-transform-runtime": "^6.9.0",
        "babel-preset-es2015": "^6.9.0",
        "babel-preset-react": "^6.5.0",
        "gulp": "^3.9.1",
        "laravel-elixir": "^5.0.0",
        "laravel-elixir-vueify": "^1.0.3",
        "vue-hot-reload-api": "^2.0.0",
        "vueify": "^8.5.4"
    },
    "dependencies": {
        "babel-runtime": "^6.9.2",
        "bootstrap-sass": "^3.3.6",
        "es6-promise": "^3.2.1",
        "vue": "^2.6.12",
        "vue-resource": "^0.8.0",
        "vue-router": "^3.4.9",
        "vuex": "^0.6.3"
    }
}

使用Workerman创建Socket服务器

https://learnku.com/articles/13151/using-laravel-to-carry-out-socket-communication-in-workerman

注意Nginx:在nginx中,可以用不同的端口号配置不同版本的php
这个把我整死了,我定义的--d后台运行 php artisan workman start --d

你可能感兴趣的:(php Laravel-admin Nginx -Socket)