You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a REST API that is a little unusual (a mix of GET and POST params - we have no control over the API unfortunately), so I need to make some amends to how Trucker hits it for certain requests.
The problem is that I'm unsure how to check what URL Trucker is hitting.
I'm using the following code inside a model:
<?php
namespace App\Models\Api;
use App\Models\Api\ApiModel;
use Trucker\Facades\ConditionFactory;
class VehicleManufacturer extends ApiModel
{
protected $uri = "manufacturers";
static function whereSlug($slug) {
$conditions = ConditionFactory::build();
$conditions->addCondition('makeSlug', '=', $slug);
$conditions->setLogicalOperator($conditions->getLogicalOperatorAnd());
$results = VehicleManufacturer::all($conditions);
dd($results);
return $results;
}
}
How would I get the URL here?
I know I can get getURI() on a model instance, but I'm not sure how to do it on an all() call, which includes the conditions (which is what I'm interested in).
The text was updated successfully, but these errors were encountered:
I'm using a REST API that is a little unusual (a mix of GET and POST params - we have no control over the API unfortunately), so I need to make some amends to how Trucker hits it for certain requests.
The problem is that I'm unsure how to check what URL Trucker is hitting.
I'm using the following code inside a model:
How would I get the URL here?
I know I can get
getURI()
on a model instance, but I'm not sure how to do it on anall()
call, which includes the conditions (which is what I'm interested in).The text was updated successfully, but these errors were encountered: