This is how you can include devices in the user model.
1namespace App\Models;2 3use Pharaonic\Laravel\Users\Traits\HasDevices; 4 5class User extends Authenticatable6{7 use HasDevices; 8}
Getting list of Devices (Agents) List.
1$devices = $user->devices;2// Returns Illuminate\Database\Eloquent\Collection
Getting list of devices FCM (Firebase Cloud Messaging).
1$fcmList = $user->fcmList;2// Returns Array|null
Getting signature of the current device.
1$signature = $user->currentDeviceSignature;2// Returns String3// Example : d16616d7-2db5-4863-be6a-de3fc1460806-nTJTGTJIdU0wWqQy
Getting the current device object.
1$device = $user->currentDevice;2// Returns Pharaonic\Laravel\Users\Models\UserAgent|null
Check if the current device has been detected or not.
1if($user->hasDetectedDevice()) {2 //3}
Detect the current user device and store info in database.
1$user->detectDevice($fcm);2// $fcm (OPTIONAL) Firebase Cloud Messaging Token3// Returns Pharaonic\Laravel\Users\Models\UserAgent Model
Remove a device with the signature.
1$user->removeDevice($signature);2// Returns boolean