Documentation


LaraGuppy: Engage, Share, Connect

Thank you so much for purchasing our item from codeCanyon.


  • Created: 15 May, 2024
  • Update: 15 May, 2024

If you have any questions that are beyond the scope of this help file, Please feel free to email via Item Support Page.


Things You Must Have:


These are prerequisites for LaraGuppy.

  • PHP: 8.2.x
  • MySQL: 8.x
  • Laravel:10.x, 11.x

This package assumes that Laravel Breeze or authentication is enabled on your Laravel application.


Installation

Follow the steps below to setup your LaraGuppy package:
  1. Unzip the downloaded package and copy the laraguppy directory to the packages directory at the root of your website using FTP or localhost to use it on your website.
    • After uploading you need to execute the following commands in the website root directory through CLI
      • Execute this – composer config repositories.laraguppy '{"type": "path", "url": "packages/laraguppy", "options":{"symlink": false}}' --file composer.json && composer config minimum-stability dev --file composer.json
      • Execute this – composer require amentotech/laraguppy
      • Execute this – php artisan vendor:publish --provider="Amentotech\LaraGuppy\LaraGuppyServiceProvider" --tag=config
      • Execute this – php artisan vendor:publish --provider="Amentotech\LaraGuppy\LaraGuppyServiceProvider" --tag=assets --force
  2. You need to set the LaraGuppy configurations in config/laraguppy.php file (e-g; db_prefix, url_prefix, route_middleware, etc).
    • If your Laravel app is running on version 11.x and you haven't installed Laravel Sanctum yet,
      please use the following command in the CLI to install it.
      • Execute this – php artisan install:api
      • Import the HasApiTokens trait in your Authenticatable class e.g; User Model use Laravel\Sanctum\HasApiTokens;
      • Add this line to your Authenticatable class e.g; User Model use HasApiTokens;
    • After configurations, you need to execute this command in CLI
      • Execute this – php artisan migrate
  3. After that you need to add the Chatable trait in your Authenticatable class e.g. User Model.
    • Import the Chatable trait in Authenticatable class e.g User Model. use Amentotech\LaraGuppy\Traits\Chatable;
    • Add this line to your Authenticatable class e.g; User Model use Chatable;
  4. After that open url your-domain.com/messenger

Realtime Notifications

LaraGuppy provides real-time notifications through integration with both Pusher and Laravel Reverb.

Pusher

To enable pusher update your app .env file as follows:

              
                BROADCAST_DRIVER=pusher
                ...
                PUSHER_APP_ID=****
                PUSHER_APP_KEY=****
                PUSHER_APP_SECRET=****
                PUSHER_APP_CLUSTER=****
              
            
Laravel Reverb

For Laravel Reverb execute this – php artisan reverb:install

Afterward, ensure that Laravel Reverb has added the following settings to your .env file configuration.

              
                BROADCAST_DRIVER=reverb
                ...
                REVERB_APP_ID=****
                REVERB_APP_KEY=****
                REVERB_APP_SECRET=****
                REVERB_HOST=****
                REVERB_PORT=****
                REVERB_SCHEME=****
              
            

LaraGuppy Configuation

After completing the installation, you have the opportunity to personalize the LaraGuppy configurations to suit your needs. You'll find an abundance of options to explore and utilize in config/laraguppy.php

Route & Layout configurations

You can set your web routes prefix and middlewares to protect chat web and API routes.


....
'url_prefix'                     => '',                 // like admin if you are using it in admin panel.
'route_middleware'               => ['auth'],           // route middlewares like auth, role etc.
'api_authentication_middleware'  => ['auth:sanctum'],   // auth:api for passport.                  
'layout'                         => 'layouts.app',      // Leave emtpy to load default layout for LaraGuppy massenger
'content_yeild'                  => 'content',          // Section variable name that yields from above layout.
'style_stack'                    => 'styles',           // Push style variable for style css.
'script_stack'                   => 'scripts',          // Push scripts variable for custom js and script files.
'redirect_url'                   => '',                 // Add the URL link of redirect button. 
....

            
Database & Eloquent settings

These settings allow you to specify the columns and relations for LaraGuppy User's information from the database. This is necessary to inform LaraGuppy that the user has fields such as name, image, and phone in the database.


....
'db_prefix'              => 'lg__',          // Prefix for database tables.
'userinfo_relation'      => '',              // If user inforamtion from other than User model please specify relation defined in user_class.
'userinfo_relation'      => 'activeProfile', // If user inforamtion from other than User model please specify relation defined in user_class.
'user_first_name_column' => 'first_name',    // If you don't have a 'first_name' column, leave it as the default 'name'.
'user_last_name_column'  => 'last_name',     // If you don't last name columns, leave empty otherwise specify last name column.
'user_email_column'      => 'email',         // It can be a column/attribute defined in user_class, leave empty if defualt users.
'user_image_column'      => 'image',         // It can be a column/attribute defined in user_class, please fill only when applicable.
'user_phone_column'      => 'phone',         // It can be a column/attribute defined in user_class, please fill only when applicable.
....

            
Enable start chat invitation

By default, it is set to 'true', meaning a chat invitation will be sent when two users try to interact. If you set it to 'false', a direct chat will be initialized without an invitation.


....
'enable_chat_invitation'         => true,
....

Tabs settings

These settings allow you to specify which tabs you want to display and the number of records per page for each tab's results.


....
'per_page_records'   => '20',                                             // Paginate record of every tab.
'enable_tabs'        => ['private_chat', 'friend_list', 'contact_list'],  // Enable tabs to show on laraguppy chat.
'default_active_tab' => 'private_chat',                                   // Default active tab when chat is loaded on page.
....

Message settings

These settings enable you to utilize multiple options and configurations for messages.


....
'default_avatar_url'              => '',              // User default avater image url
'delete_message'                  => true,            // Allow delete unseen message option
'default_active_tab'              => 'private_chat',  // Default active tab when chat is loaded on page.
'clear_chat'                      => true,            // Allow clear chat option
'time_format'                     => '12hrs',         // Message time format 12hrs or 24hrs

'location_sharing'                => true,            // Enable location sharing option 
'emoji_sharing'                   => true,            // Enable emoji sharing option 
'voice_sharing'                   => true,            // Enable voice note sharing option 
....

Media settings

These settings allow you to adjust the permitted file extensions and sizes for message attachments.


....
'image_size'                => 5000,                            // Upload image size in "KB"
'image_ext'                 => ['.jpg','.jpeg','.gif','.png'],  // Upload image file allowed extensions
'audio_file_size'           => 10000,                           // Upload audio file size in "KB"
'audio_file_ext'            => ['.mp3','.wav'],                 // Upload audio file allowed extensions
'video_file_size'           => 10000,                           // Upload video file size in "KB"
'video_file_ext'            => ['.mp4','.flv','.3gp'],          // Upload video file allowed extensions
'document_file_size'        => 10000,                           // Upload document file size in "KB"
'document_file_ext'         => ['.pdf','.doc','.txt'],          // Upload video file allowed extensions
'notification_bell_url'     => '',                              // Add the audio file url on new message.
....

Role Settings

When using Spatie's LARAVEL-PERMISSION package, you can exclude specific roles by passing them as an array. Leave the array empty if roles are not being used.


....
'exclude_roles'             => ['admin']
....


LaraGuppy Features

  • Feature for sending friend requests.
  • Option to block or unblock friends.
  • Direct chat initiation without needing a friend request.
  • Multiple tabs for chats, friends, and contacts.
  • One-on-one chat capability.
  • Synchronization across multiple devices in real-time.
  • Updates to the contact list in real-time.
  • Display of user's online status in real-time.
  • Indicator for real-time typing.
  • Indicators for messages being delivered and seen in real-time.
  • Search functionality within the app.
  • Indicator for the last message in conversation threads.
  • Functionality to upload various attachments like photos, files, locations, videos, and audio.
  • Ability to send voice messages.
  • Feature to send emojis.
  • Capability to view and download all media from conversations.
  • Function to clear conversation history.
  • Options to mute notifications at the conversation and account levels.
  • User details panel including shared photos and conversation clearing options.
  • Responsive design compatible with all devices.
  • Customization of user profiles.

Changelog

See what's new added, changed, fixed, improved, or updated in the latest versions.

Version 1.0 (15 May, 2024)

- Initial Release