class DatabaseRouteRepository implements RouteRepository

class DatabaseRouteRepository

Properties

array $protectedUrl Protected keyword for url first segment
protected Repository $configs Laravel config instance
protected string $model The route model

Methods

__construct(Repository $configs, string $model)

DatabaseRouteRepository constructor.

all()

Returns all route items

findByUrlAndSiteKey(string $url, string $siteKey)

Retrieve a route by url segment and site key

findByInstanceId(string $instanceId)

Retrieve a route by instance identifier

fetchBySiteKey(string $siteKey)

Retrieve routes by site key

fetchByModule(string $module)

Retrieve routes by module name

create(array $input)

Save a new route item and return the instance

put(InstanceRoute $route)

Save the route item

bool
validateUrl(string $siteKey, string $url, bool $isNew)

Check validate given url

bool|null
delete(InstanceRoute $route)

Delete the route item from the repository

Model
createModel()

Create a new instance of the model.

string
getModel()

Gets the name of the Eloquent user model.

$this
setModel(string $model)

Sets the name of the Eloquent user model.

Details

at line 69
__construct(Repository $configs, string $model)

DatabaseRouteRepository constructor.

Parameters

Repository $configs Laravel config instance
string $model The route model

at line 80
InstanceRoute[] all()

Returns all route items

Return Value

InstanceRoute[]

at line 92
InstanceRoute findByUrlAndSiteKey(string $url, string $siteKey)

Retrieve a route by url segment and site key

Parameters

string $url first segment of url
string $siteKey site key

Return Value

InstanceRoute

at line 105
InstanceRoute findByInstanceId(string $instanceId)

Retrieve a route by instance identifier

Parameters

string $instanceId instance identifier

Return Value

InstanceRoute

at line 118
InstanceRoute[] fetchBySiteKey(string $siteKey)

Retrieve routes by site key

Parameters

string $siteKey site key

Return Value

InstanceRoute[]

at line 131
InstanceRoute[] fetchByModule(string $module)

Retrieve routes by module name

Parameters

string $module module name

Return Value

InstanceRoute[]

at line 144
InstanceRoute create(array $input)

Save a new route item and return the instance

Parameters

array $input route item attributes

Return Value

InstanceRoute

at line 159
InstanceRoute put(InstanceRoute $route)

Save the route item

Parameters

InstanceRoute $route route instance

Return Value

InstanceRoute

at line 178
protected bool validateUrl(string $siteKey, string $url, bool $isNew)

Check validate given url

Parameters

string $siteKey site key
string $url first segment of url
bool $isNew if create new route then given true

Return Value

bool

at line 204
bool|null delete(InstanceRoute $route)

Delete the route item from the repository

Parameters

InstanceRoute $route route instance

Return Value

bool|null

at line 214
Model createModel()

Create a new instance of the model.

Return Value

Model

at line 226
string getModel()

Gets the name of the Eloquent user model.

Return Value

string

at line 237
$this setModel(string $model)

Sets the name of the Eloquent user model.

Parameters

string $model model class

Return Value

$this