Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get the request URL Trucker is hitting? #30

Open
mikemike opened this issue Dec 20, 2016 · 0 comments
Open

How can I get the request URL Trucker is hitting? #30

mikemike opened this issue Dec 20, 2016 · 0 comments

Comments

@mikemike
Copy link

mikemike commented Dec 20, 2016

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant