Profile API
Manage user profiles with full CRUD operations.
Get a Profile
$profile = $sociable->profiles()->get($userId);
Get Profile by Handle
$profile = $sociable->profiles()->getByHandle('johndoe');
Get Multiple Profiles (Batch)
$userIds = [1, 2, 3, 4, 5];
$profiles = $sociable->profiles()->getBatch($userIds);
Update Profile
$sociable->profiles()->update($userId, [
'bio' => 'Updated bio text',
'location' => 'San Francisco',
'website' => 'https://newsite.com',
]);
Check if Profile Exists
if ($sociable->profiles()->exists($userId)) {
// Profile exists
}
Get Profile URL and Link
$url = $sociable->profiles()->getUrl($userId);
$link = $sociable->profiles()->link($userId, [
'class' => 'profile-link',
'target' => '_blank',
]);