Contacts dependency for Laravel Enso.
- allows the management of contact persons, attached to other entities, such as companies
- uses a polymorphic relationship for flexibility when attaching
- contacts can be disabled while still keeping them, for reference
- comes with a
Contacts.vueVueJS component meant to be included anywhere, and an index page to list all contacts
- uses the VueComponents package in order to load its VueJS dependencies
The component is no longer included in the Enso install and is incompatible with the latest Companies package, which comes with its own contacts structure.
If you require this package, uninstall the Companies package first and install this package instead.
- Add the
Contactabletrait in the Model to which you need to add contacts You can then use the
- Use the VueJS component in your pages/components
<contacts type="modelClass" id="entityId" :open="true" title="My Custom Title" > </contacts>
Contacts.vue component can be used anywhere, can be integrated into any other component or page, and takes the following parameters:
id- the id of the entity | required
type- string, the entity type, set in the configuration file | required
open- boolean, flag which, if true, makes the component start in the open state | default
title- string, title for the component | default 'Contacts' | (optional)
config/enso/contacts.php file, you'll find several customization options:
onDelete, string, option that manages the case when the commentable entity is deleted and it has attached discussions. Valid options are
restrict| default is
With the cascade option, when a discussable model is deleted, the discussions attached to it are also deleted. With the restrict option, when attempting to delete a discussable model with attached discussions, an exception is thrown.
loggableMorph, the list of entities using the addressable functionality, each mapped to its respective loggable attribute For example:
'addressable' => [ Company::class => 'name', ],
php artisan vendor:publish --tag=contacts-config- the configuration file
php artisan vendor:publish --tag=contacts-assets- the VueJS components
php artisan vendor:publish --tag=enso-assets- a common alias for when wanting to update the VueJS component, once a newer version is released, can be used with the
php artisan vendor:publish --tag=enso-config- a common alias for when wanting to update the config, once a newer version is released, can be used with the
The Laravel Enso package comes with this package included.