1
|
|
|
<?php namespace Arcanedev\Support\Routing; |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Class RouteRegistrar |
5
|
|
|
* |
6
|
|
|
* @package Arcanedev\Support\Laravel |
7
|
|
|
* @author ARCANEDEV <[email protected]> |
8
|
|
|
* |
9
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar as(string $name) |
10
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar domain(string $domain) |
11
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar middleware(string $middleware) |
12
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar name(string $name) |
13
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar namespace(string $namespace) |
14
|
|
|
* @method \Arcanedev\Support\Routing\RouteRegistrar prefix(string $prefix) |
15
|
|
|
* @method void group(...$mixed) |
16
|
|
|
* |
17
|
|
|
* @method \Illuminate\Routing\Route get($uri, $action = null) |
18
|
|
|
* @method \Illuminate\Routing\Route post($uri, $action = null) |
19
|
|
|
* @method \Illuminate\Routing\Route put($uri, $action = null) |
20
|
|
|
* @method \Illuminate\Routing\Route patch($uri, $action = null) |
21
|
|
|
* @method \Illuminate\Routing\Route delete($uri, $action = null) |
22
|
|
|
* @method \Illuminate\Routing\Route options($uri, $action = null) |
23
|
|
|
* @method \Illuminate\Routing\Route any($uri, $action = null) |
24
|
|
|
* @method \Illuminate\Routing\Route match($methods, $uri, $action = null) |
25
|
|
|
* |
26
|
|
|
* @method void resource($name, $controller, array $options = []) |
27
|
|
|
* @method void resources(array $resources) |
28
|
|
|
* |
29
|
|
|
* @method void pattern($key, $pattern) |
30
|
|
|
* @method void patterns($patterns) |
31
|
|
|
* |
32
|
|
|
* @method void model($key, $class, \Closure $callback = null) |
33
|
|
|
* @method void bind($key, $binder) |
34
|
|
|
*/ |
35
|
|
|
abstract class RouteRegistrar |
36
|
|
|
{ |
37
|
|
|
/* ------------------------------------------------------------------------------------------------ |
38
|
|
|
| Main Functions |
39
|
|
|
| ------------------------------------------------------------------------------------------------ |
40
|
|
|
*/ |
41
|
|
|
/** |
42
|
|
|
* Register and map routes. |
43
|
|
|
*/ |
44
|
|
|
public static function register() |
45
|
|
|
{ |
46
|
|
|
(new static)->map(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/* ------------------------------------------------------------------------------------------------ |
50
|
|
|
| Main Functions |
51
|
|
|
| ------------------------------------------------------------------------------------------------ |
52
|
|
|
*/ |
53
|
|
|
/** |
54
|
|
|
* Map routes. |
55
|
|
|
*/ |
56
|
|
|
abstract public function map(); |
57
|
|
|
|
58
|
|
|
/* ------------------------------------------------------------------------------------------------ |
59
|
|
|
| Other Functions |
60
|
|
|
| ------------------------------------------------------------------------------------------------ |
61
|
|
|
*/ |
62
|
|
|
/** |
63
|
|
|
* @param string $name |
64
|
|
|
* @param array $arguments |
65
|
|
|
* |
66
|
|
|
* @return mixed |
67
|
|
|
*/ |
68
|
|
|
public function __call($name, $arguments) |
69
|
|
|
{ |
70
|
|
|
return app('router')->$name(...$arguments); |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|