so2platform / publicprofile
Public Profile for Laravel 5
Installs: 95
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.3.0
README
Synergy O2
####How Install
-
Important, this package requieres node.js and npm installed.
-
Run composer require so2platform/publicprofile composer require league/flysystem-aws-s3-v3 composer require predis/predis composer require league/flysystem-aws-s3-v3 ~1.0
-
Run.
npm install express ioredis socket.io --save #Or if using yarn : yarn add express ioredis socket.io --save
-
Configure your aws s3 bucket credentials at config/publicprofile.php
-
In env file change BROADCAST_DRIVER driver to redis
BROADCAST_DRIVER=redis
-
Add package ServiceProvider to conf/app.php providers
So2platform\Publicprofile\Providers\PublicProfileServiceProvider::class,
-
Run dump-autoload
composer dump-autoload
-
Publish package content
php artisan vendor:publish --provider="So2platform\Publicprofile\Providers\PublicProfileServiceProvider"
-
Now in the browser navigate to http://"projectname"/profile/installer and select install.
This will generate the required tables on configured database connection. -
Start the nodejs server
node vendor/so2platform/publicprofile/socket.js
-
Configure auth model, model primary id and s3 settings in config/publicprofile.php
/* Node server 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. ]
-
Now you've installed the Public Profiles App, now goto to http://yourlocal/profile/installer
####Setup This package requieres a little configuration at conf/publicprofiles file parameters:
- default_auth_model_id = If there's not an active session then we use this.
- default_public_profile_id = We need an id (session, login, etc...) in order to associate a profile to it, if's doesn't exists then the package will use this.
- auth_model_key = session/model id key name.
- auth_guard = guard name.
- views_to_use = This configuration parameter is in order use the base views (within package) or publised views. this is important parameter because we will not extend or publish controllers. (views can override this at extends line).
- backend_home_view = Default backend view.
- backend_home_view = This is because if a user is searched by id or his nickname at url bar the package creates a instance of session of his profile to show (like a default profile in the browser).