2023-05-12 10:09:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a provider reference ID
|
|
|
|
*/
|
|
|
|
namespace App\Traits;
|
|
|
|
|
|
|
|
use App\Models\ProviderOauth;
|
|
|
|
|
|
|
|
trait ProviderRef
|
|
|
|
{
|
|
|
|
public function provider_ref(ProviderOauth $poo): ?string
|
|
|
|
{
|
2024-08-12 10:58:35 +00:00
|
|
|
return (($x=$this->providers->where('pivot.provider_oauth_id',$poo->id))->count() === 1)
|
|
|
|
? $x->pop()->pivot->ref
|
|
|
|
: NULL;
|
2023-05-12 10:09:51 +00:00
|
|
|
}
|
|
|
|
}
|