c0d3rsmx / publicprofile by antoniobg

Public Profile for Laravel 5
95
0
2
Package Data
Maintainer Username: antoniobg
Maintainer Contact: jabg1992@gmail.com (Juan Becerra)
Package Create Date: 2017-02-28
Package Last Update: 2018-04-27
Language: PHP
License: Unknown
Last Refreshed: 2024-11-24 15:04:43
Package Statistics
Total Downloads: 95
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Public Profile for Laravel 5

Alt textAlt text

Synergy O2

####How Install

  1. Important, this package requieres node.js and npm installed.

  2. 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

  3. Run.

    npm install express ioredis socket.io --save #Or if using yarn : yarn add express ioredis socket.io --save

  4. Configure your aws s3 bucket credentials at config/publicprofile.php

  5. In env file change BROADCAST_DRIVER driver to redis

    BROADCAST_DRIVER=redis

  6. Add package ServiceProvider to conf/app.php providers

    So2platform\Publicprofile\Providers\PublicProfileServiceProvider::class,

  7. Run dump-autoload

    composer dump-autoload

  8. Publish package content

    php artisan vendor:publish --provider="So2platform\Publicprofile\Providers\PublicProfileServiceProvider"

  9. Now in the browser navigate to http://"projectname"/profile/installer and select install. This will generate the required tables on configured database connection.

  10. Start the nodejs server

    node vendor/so2platform/publicprofile/socket.js

  11. 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.
     ]
    
  12. 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).