🐛 FIX: Provider selection

This commit is contained in:
Austin Ginder 2024-11-17 18:44:32 -05:00
parent 4ab086965d
commit 2d5c6d28bb

View file

@ -8,9 +8,10 @@ class Provider {

public function __construct( $provider_id = "" ) {
if ( ! is_numeric( $provider_id ) ) {
$lookup = ( new Providers )->where( [ "provider" => $provider_id ] );
$lookup = Providers::where( [ "provider" => $provider_id ] );
if ( count( $lookup ) > 0 ) {
$provider_id = $lookup[0]->provider_id;
$last_item_key = count($lookup) -1;
$provider_id = $lookup[ $last_item_key ]->provider_id;
}
}
$this->provider_id = $provider_id;