Download the PHP package quickcamx/devices without Composer
On this page you can find all versions of the php package quickcamx/devices. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quickcamx/devices
More information about quickcamx/devices
Files in quickcamx/devices
Package devices
Short Description Manage mobile devices and tokens easily with Laravel
License MIT
Homepage https://github.com/sfolador/devices
Informations about the package devices
Manage mobile devices and tokens easily with Laravel
Easily manage devices and device tokens for your users.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
if you set allow_device_reassign
to true, it will be possible to
register a device for a user and then assign it to another user. This happens usually
in mobile applications with multi-accounts on the same device.
You can publish and run the migrations with:
the migration will create the Devices
table and its columns will be:
id
- the device idnotifiable_id
- the "user" idnotifiable_type
- the "user" typename
- the device nametype
- the device type (mobile, web)platform
- the device platform (ios, android, web)token
- the device tokencreated_at
- the device creation dateupdated_at
- the device update date
Usage
It's possible to use the HasDevices
trait in your User
model:
At this point is possible to retrieve the devices of a user:
To register a new Device
, for example from a mobile app, you can use the provided route POST /api/devices/attach
:
Device parameters
The register a Device you need a request with these parameters:
DevicePlatform is an Enum that can have these values: android, ios, web. DeviceType is an Enum that can have these values: mobile, web
Firebase notifications
If needed, this package can send push notifications with Firebase through the use of : kutia-software-company/larafirebase
(https://github.com/kutia-software-company/larafirebase) ,
already present in the composer.json
.
You need to publish the configuration of kutia-software-company/larafirebase
by launching:
you will find the larafirebase.php
file in the config folder. The file looks like this:
Please remind that you need to obtain the authentication_key from Firebase
Notifiable configuration
You need to setup your notifiable class by adding the RouteNotifications
trait:
You are now ready to send a notification to the user:
If you need more freedom on the notification fields you can always create another PushNotification class or extend
\Sfolador\Devices\Notifications\FirebasePushNotification
.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- sfolador
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of devices with dependencies
guzzlehttp/guzzle Version ^7.5
illuminate/contracts Version ^10.0
kutia-software-company/larafirebase Version ^1.3
spatie/laravel-data Version ^3.1
spatie/laravel-package-tools Version ^1.14.0