After Upgrade error access /velocity: Trying to get property 'advertisement' of non-object
-
Open: /var/www/vhosts/morningstarfoods.co.za/bagisto_v1/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php
* Create a new controller instance.
*
* @param \Webkul\Velocity\Repositories\MetadataRepository $metaDataRepository
*/public function __construct ( VelocityMetadataRepository $velocityMetadataRepository ) { $this->_config = request('_config'); $this->velocityHelper = app('Webkul\Velocity\Helpers\Helper'); $this->velocityMetaDataRepository = $velocityMetadataRepository; } public function renderMetaData() { $velocityMetaData = $this->velocityHelper->getVelocityMetaData(); if ( $velocityMetaData->advertisement ) { $velocityMetaData->advertisement = $this->manageAddImages(json_decode($velocityMetaData->advertisement, true)); } return view($this->_config['view'], [ 'metaData' => $velocityMetaData ]); } public function storeMetaData($id) { // check if radio button value if (request()->get('slides') == "on") { $params = request()->all() + [ 'slider' => 1 ]; } else { $params = request()->all() + [ 'slider' => 0 ]; }
Arguments
"Trying to get property 'advertisement' of non-object" -
Hi @andrewc
Database seeding is not done properly.
so run php artisan db:seed command -
Also to seed for an individual class, try below command
php artisan db:seed --class=\Webkul\Velocity\Database\Seeders\VelocityMetaDataSeeder