so2platform / publicprofile
Laravel 5的公共配置文件
Requires
- php: >=5.3.0
README
Synergy O2
####如何安装
-
重要,此包需要已安装 node.js 和 npm。
-
运行
composer require so2platform/publicprofile
composer require league/flysystem-aws-s3-v3
composer require predis/predis
composer require league/flysystem-aws-s3-v3 ~1.0
-
运行。
运行
npm install express ioredis socket.io --save
#或者如果使用yarn:yarn add express ioredis socket.io --save
-
在 config/publicprofile.php 中配置您的aws s3桶凭证
-
在env文件中将BROADCAST_DRIVER的驱动程序更改为redis
BROADCAST_DRIVER=redis
-
将包ServiceProvider添加到conf/app.php的providers
So2platform\Publicprofile\Providers\PublicProfileServiceProvider::class,
-
运行dump-autoload
运行
composer dump-autoload
-
发布包内容
运行
php artisan vendor:publish --provider="So2platform\Publicprofile\Providers\PublicProfileServiceProvider"
-
现在在浏览器中导航到 http://"projectname"/profile/installer 并选择 安装。
这将在配置的数据库连接上生成所需的表。 -
启动nodejs服务器
运行
node vendor/so2platform/publicprofile/socket.js
-
在config/publicprofile.php中配置认证模型、模型主键和s3设置
/* Node服务器URL */ 'node_server' => 'http://cmsmodule.local:3000',
'default_auth_model_id' => 1, 'default_public_profile_id' => 1, 'auth_model_key' => "id_cliente", 'auth_guard' => "web", /* Public profile backend Home view */ 'backend_home_view' => 'public_profile', /* Public session settings */ 'public_session_instance' => '', /* S3 Config */ 's3_public_profile' => [ 'S3_KEY' => env('AWS_KEY'), 'S3_SECRET' => env('AWS_SECRET'), 'S3_REGION' => env('AWS_REGION'), 'S3_BUCKET' => 'https://'.env('AWS_BUCKET').'.s3.amazonaws.com/', 'S3_BUCKET_POSTS_DIRECTORY' => 'public/publicprofiles/profileposts/', // With slash at end. 'S3_BUCKET_IMAGES_DIRECTORY' => 'public/publicprofiles/profileimages/', // With slash at end. 'S3_BUCKET_COVER_DIRECTORY' => 'public/publicprofiles/profilecovers/', // With slash at end. ]
-
现在您已安装了公共配置文件应用程序,现在转到 http://yourlocal/profile/installer
####设置此包需要在conf/publicprofiles文件中稍作配置
- default_auth_model_id = 如果没有活动会话,则使用此。
- default_public_profile_id = 我们需要一个id(会话、登录等...)以将配置文件与其关联,如果不存在,则包将使用此。
- auth_model_key = 会话/模型ID键名。
- auth_guard = 守护程序名称。
- views_to_use = 此配置参数是为了使用基本视图(在包内)或已发布视图。这是一个重要参数,因为我们不会扩展或发布控制器。(视图可以在extends行覆盖此参数)。
- backend_home_view = 默认后端视图。
- backend_home_view = 这是因为如果用户通过id或昵称在url栏中搜索,则包会创建一个会话实例以显示其配置文件(如在浏览器中的默认配置文件)。