Error

We're sorry, but an unhandled error occurred. Please see the details below.

Trying to get property of non-object

/home/knisse/public_html/plugins/rainlab/blog/components/Post.php line 55

    {
        /**
        * URL manipulation
        */
 
        $uri = $this->getRouter()->getParameters();
        $catId = BlogPost::where('slug', '=', $uri['slug'])->first()['categories'][0]->id;
        $currentCat = $this->getParent($catId)[0]->name;
        $current_url = $_SERVER['REQUEST_URI'];
        $categorie = str_replace(array('/v2/', '/'.$uri['slug'], '/'), array('', '', ''), $current_url);
        $the_one = url(\Str::slug($currentCat).'/'.$uri['slug']);
        $this->page['canonical'] = $the_one;
        if($categorie != \Str::slug($currentCat))

Stack trace

# Called Code Document Line
19 RainLab\Blog\Components\Post->onRun() http://www.ouedknisse.info/modules/cms/classes/CmsCompoundObject.php 127
18 Cms\Classes\CmsCompoundObject->runComponents() http://www.ouedknisse.info/modules/cms/classes/Controller.php 560
17 Cms\Classes\Controller->execPageCycle() http://www.ouedknisse.info/modules/cms/classes/Controller.php 247
16 Cms\Classes\Controller->run()
15 call_user_func_array() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/Controller.php 231
14 Illuminate\Routing\Controller->callAction() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php 93
13 Illuminate\Routing\ControllerDispatcher->call() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php 62
12 Illuminate\Routing\ControllerDispatcher->dispatch() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php 962
11 Illuminate\Routing\Router->Illuminate\Routing\{closure}()
10 call_user_func_array() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/Route.php 109
9 Illuminate\Routing\Route->run() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php 1028
8 Illuminate\Routing\Router->dispatchToRoute() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Routing/Router.php 996
7 Illuminate\Routing\Router->dispatch() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 775
6 Illuminate\Foundation\Application->dispatch() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 745
5 Illuminate\Foundation\Application->handle() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Session/Middleware.php 72
4 Illuminate\Session\Middleware->handle() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php 47
3 Illuminate\Cookie\Queue->handle() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php 51
2 Illuminate\Cookie\Guard->handle() http://www.ouedknisse.info/vendor/stack/builder/src/Stack/StackedHttpKernel.php 23
1 Stack\StackedHttpKernel->handle() http://www.ouedknisse.info/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 641
0 Illuminate\Foundation\Application->run() http://www.ouedknisse.info/index.php 56