1 | <?php namespace Arcanedev\LaravelSeo; |
||
12 | class RedirectorManager extends Manager implements RedirectorFactory |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Getters & Setters |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Get the default driver name. |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | 18 | public function getDefaultDriver() |
|
28 | |||
29 | /* ----------------------------------------------------------------- |
||
30 | | Main Methods |
||
31 | | ----------------------------------------------------------------- |
||
32 | */ |
||
33 | |||
34 | /** |
||
35 | * Get a driver instance. |
||
36 | * |
||
37 | * @param string $driver |
||
38 | * |
||
39 | * @return \Arcanedev\LaravelSeo\Contracts\Redirector |
||
40 | */ |
||
41 | 20 | public function driver($driver = null) |
|
45 | |||
46 | /** |
||
47 | * Build the config redirector driver. |
||
48 | * |
||
49 | * @return \Arcanedev\LaravelSeo\Redirectors\ConfigurationRedirector |
||
50 | */ |
||
51 | 18 | public function createConfigDriver() |
|
55 | |||
56 | /** |
||
57 | * Build the eloquent redirector driver. |
||
58 | * |
||
59 | * @return \Arcanedev\LaravelSeo\Redirectors\EloquentRedirector |
||
60 | */ |
||
61 | 2 | public function createEloquentDriver() |
|
62 | { |
||
63 | 2 | return $this->buildDriver('eloquent', [ |
|
64 | 2 | 'model' => Seo::getConfig('redirects.model'), |
|
65 | ]); |
||
66 | } |
||
67 | |||
68 | /* ----------------------------------------------------------------- |
||
69 | | Other Methods |
||
70 | | ----------------------------------------------------------------- |
||
71 | */ |
||
72 | |||
73 | /** |
||
74 | * Build the redirector. |
||
75 | * |
||
76 | * @param string $driver |
||
77 | * @param array $extra |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 20 | private function buildDriver($driver, array $extra = []) |
|
89 | } |
||
90 |