From b33e69fbbba1a7841d2febc0fffe423d5cbe5a39 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sun, 16 Oct 2016 12:18:34 +0100 Subject: [PATCH] Use new request file --- src/Http/Request.php | 29 +++++++++++++++++++++++++++++ src/Routing/RoutingServiceProvider.php | 3 +++ 2 files changed, 32 insertions(+) diff --git a/src/Http/Request.php b/src/Http/Request.php new file mode 100644 index 0000000..8afb57d 100644 --- /dev/null +++ a/src/Http/Request.php @@ -1,0 +1,29 @@ + + */ +class Request extends BaseRequest +{ + /** + * @var Post + */ + private $post; + + /** + * Get the Post instance this request has asked for. + * + * @return Post + */ + public function post() + { + return $this->post ?: $this->post = Post::find(Wordpress::id()); + } +} diff --git a/src/Routing/RoutingServiceProvider.php b/src/Routing/RoutingServiceProvider.php index b41d811..b3d79e7 100644 --- a/src/Routing/RoutingServiceProvider.php +++ a/src/Routing/RoutingServiceProvider.php @@ -1,8 +1,9 @@ app->alias('request', Request::class); + $routing = new Routing; // Router methods -- rgit 0.1.5