Flugg\Responder\Http\SuccessResponseBuilder::resolveResourceKey PHP Method

resolveResourceKey() protected method

Resolve the resource key from the model.
protected resolveResourceKey ( Model $model, string $resourceKey = null ) : string
$model Illuminate\Database\Eloquent\Model
$resourceKey string
return string
    protected function resolveResourceKey(Model $model, string $resourceKey = null) : string
    {
        if (!is_null($resourceKey)) {
            return $resourceKey;
        }
        if (method_exists($model, 'getResourceKey')) {
            return $model->getResourceKey();
        }
        return $model->getTable();
    }