Skip to content

Commit 36017a6

Browse files
committed
fix LaraPress facade
1 parent 9140e27 commit 36017a6

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

src/LaraPress.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ public function __construct()
2222
$this->meta['url'] = url(config('larapress.path'));
2323
}
2424

25-
/**
26-
* Get the URI path prefix.
27-
*
28-
* @return string
29-
*/
30-
public static function path()
31-
{
32-
return config('larapress.path', '/blog');
33-
}
34-
3525
/**
3626
* Check if config file has been set.
3727
*
@@ -82,6 +72,16 @@ public static function trending($limit = null)
8272
return ($limit) ? $trending->take($limit) : $trending;
8373
}
8474

75+
/**
76+
* Get the URI path prefix.
77+
*
78+
* @return string
79+
*/
80+
public function path()
81+
{
82+
return config('larapress.path', '/blog');
83+
}
84+
8585
/**
8686
* Accepts three types of parameters. If an array is passed in, it will merge it with the
8787
* existing meta array. If a string is passed in, then it will return the value stored

src/LaraPressBaseServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Facades\Route;
66
use Illuminate\Support\ServiceProvider;
7+
use vicgonvt\LaraPress\Facades\LaraPress;
78

89
class LaraPressBaseServiceProvider extends ServiceProvider
910
{
@@ -31,9 +32,9 @@ protected function registerResources()
3132
$this->loadViewsFrom(__DIR__.'/../resources/views', 'larapress');
3233
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
3334

34-
$this->registerRoutes();
3535
$this->registerHelpers();
3636
$this->registerFacades();
37+
$this->registerRoutes();
3738
}
3839

3940
/**
@@ -79,7 +80,7 @@ protected function registerHelpers()
7980
protected function registerFacades()
8081
{
8182
$this->app->singleton('LaraPress', function ($app) {
82-
return new LaraPress();
83+
return new \vicgonvt\LaraPress\LaraPress();
8384
});
8485
}
8586

src/Post.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace vicgonvt\LaraPress;
44

5+
use vicgonvt\LaraPress\Facades\LaraPress;
6+
57
class Post extends Model
68
{
79
/**

src/Series.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace vicgonvt\LaraPress;
44

5+
use vicgonvt\LaraPress\Facades\LaraPress;
6+
57
class Series extends Model
68
{
79
/**

src/Tag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace vicgonvt\LaraPress;
44

5+
use vicgonvt\LaraPress\Facades\LaraPress;
6+
57
class Tag extends Model
68
{
79
/**

0 commit comments

Comments
 (0)