Download the PHP package geekyants/share-dialog without Composer

On this page you can find all versions of the php package geekyants/share-dialog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package share-dialog

Sharedo

Latest Version on Packagist License Total Downloads

Share Popup for Laravel Apps

1) Introduction

Sharedo provides you an interface to manage roles and permissions for Laravel apps. You can assign read or write permissions to a user and remove the permissions as required. It is powered by Inertia.js and Laravel Bouncer.

2) Motivation

We realised that it is very time consuming to add a share functionality to Laravel projects and this can hinder the development process.
This package aims to solve this problem by enabling you to share your project's entities with other users easily.

3) Dependencies

If you have Tailwind and Bouncer pre-installed, you can move on to the Installation section.

Tailwind Installation

Install Tailwind as shown below:

Next, generate your tailwind.config.js file:

In your tailwind.config.js file, configure the purge option with the paths to all of your Blade templates and JavaScript components so Tailwind can tree-shake unused styles in production builds:

In your webpack.mix.js, add tailwindcss as a PostCSS plugin:

Open the ./resources/css/app.css file and add the following code, replacing the original file contents:

Next, import your stylesheet in your main Blade layout (commonly resources/views/layouts/app.blade.php or similar) and add the responsive viewport meta tag if it's not already present:

Bouncer Installation

Install Bouncer with composer:

Add Bouncer's trait to your user model:

Publish Bouncer's migrations to your app's migrations directory by running the following command:

4) Installation

  1. Install the Sharedo package using composer as shown below:

  2. After installation, move the package's config file to your project's config folder:

  3. Moving forward, scaffold the view components present in the sharedo package as follows:

    Sharedo folder containing Vue.js components will be created in your resources directory. You can now easily customise your Sharedo's Vuejs components 🚀

  4. Now, run the migrations. After executing this command, Bouncer migrations and the new_users_sharedo table will be migrated:

5) To compile and minify the CSS and JavaScript files generated by sharedo, add this to your webpack.mix.js file:

> Note: If your css is not compiled in your app.css file, you can change it in the sharedo.blade.php file.

6) Install the dependencies:

7) Finally, build your assets as shown below:

5) Usage

You must define a relation user on the entity model that you want to share. The relation should return the user of that entity.

To share your entity with other users, visit:

For example, if you want to open Sharedo for a project model with id 123, then visit:

Note: The entity_name should have the same name as that of the database migration corresponding to the model that you want to share.

Note: Sharedo sends error messages back to your application in the error props.

If you invite a user who is not present in your database, Sharedo automatically creates it in your users table. Also, a new entry is inserted into the new_users_sharedo table referencing the user's id as a foreign key and has_ever_logged_in property is set to false.
This can help you differentiate between the users created by Sharedo and users created by the usual sign-up flow.

To restrict other users from accessing your entities, you have to explicitly use the Bouncer methods here.

Note: Uses who are given write access to the entity can also share that entity with other users.

6) Customisation

You can customise the functionality of Sharedo easily by making changes in the sharedo.php file present in your config folder.

You can customise the functionality of Sharedo easily by making changes to the sharedo.php file present in your config folder.

  1. If your files are not present in the App\Models\\, then change the modelPath to that location instead of App\Models\\.

  2. To add your own custom middleware to Sharedo, append it to the middleware array.
    For example, if you want to add the "admin" middleware, then your middleware array will look like this:

  3. If you want only certain entities to be shareable, you can add them to the  restrict-entities array.
    For instance, if you want only the files entity to be shareable, your array will look like this:

  4. You can also send email notifications to the users when they are given access to an entity.
    Sharedo fires an UserAbilityChanged event when a user's access is changed and attaches the SendUserAbilityChangedNotification listener to it. If you want to send an email notification, make the following changes in EventServiceProvider:

    You can also modify the email template by publishing the Sharedo mail resources:

    After running this command, the mail notification template will be located in the resources/vendor/sharedo/mail directory:

    You can attach your own listeners to the event. For example, if you want to attach a SendSlackNotification listener to the UserAbilityChanged event, execute the following:

  5. To provide an option that allows searching for users, you can create a class that implements UserContactsInterface.php from the package and define the getUserContacts function.

    The return type of the getUserContacts function should be a string containing a JSON representation of an array of objects. Each object denoting a user must have an "email" attribute as shown below:

    For example, you can create a class called SendUserContacts which implements UserContactsInterface and performs an operation to get users in the getUserContacts function:

    In sharedo.config file set the "typehead" key to the SendUserContacts class path:

7) Tech Stack

Laravel, Tailwind, Bouncer, Vue.js, Inertia.js

8) Contributors

9) How to Contribute

Thank you for your interest in contributing to Sharedo! We are lucky to have you 🙂 Head over to Contribution Guidelines and learn how you can be a part of a wonderful, growing community.

For major changes, please open an issue first to discuss changes and update tests as appropriate.

10) License

Licensed under the MIT License. Please see the License File for more information.


All versions of share-dialog with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
laravel/ui Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package geekyants/share-dialog contains the following files

Loading the files please wait ....