Each call to the builder will modify the underlying pending request. Every modification, another link in the chain, that will be sent, finally, with get().
The Ticket Model class Ticket { public function get(): Collection { $settings = config('services.connectwise'); $response = Http::baseUrl($settings['url']) ->withBasicAuth("{$settings['company_id']}+{$settings['public_key']}", $settings['private_key'], ) ->asJson() ->acceptJson() ->withHeaders(['clientId' => $settings['client_id']]) ->throw() ->get($this->url()); return new Collection($response->json()); } public function url(): string { return '/tickets'; }}app/ConnectWise/Models/Ticket.php
class Ticket { use ForwardsCalls; // url() public function newRequest(): RequestBuilder { return new RequestBuilder($this); } public function __call($method, $parameters) { return $this->forwardCallTo($this->newRequest(), $method, $parameters); }}app/ConnectWise/Models/Ticket.php$tickets = Ticket::get(); // instead of $tickets = (new RequestBuilder(new Ticket))->get(); Modifying the request
abstract class Model { use ForwardsCalls; abstract public function url(): string; // get() // newRequest() // __call() // __callStatic()}app/ConnectWise/Models/Model.phpclass Ticket extends Model { public function url(): string { return '/tickets'; }}app/ConnectWise/Models/Ticket.php