php - Trying to get property of non-object in Laravel 5 after upgrade -
i created first laravel package out of old php script teamspeak auth service. main app running laravel 4, has been upgraded laravel 5. package worked before, not.
the error -
[2017-08-17 22:04:29] local.error: errorexception: trying property of non-object in /apppath/vendor/eveseat/services/src/settings/settings.php:86 stack trace: #0 /apppath/vendor/eveseat/services/src/settings/settings.php(86): illuminate\foundation\bootstrap\handleexceptions->handleerror(8, 'trying p...', '/apppath/$ #1 /apppath/vendor/laravel/framework/src/illuminate/cache/repository.php(349): seat\services\settings\settings::seat\services\settings\{closure}() #2 /apppath/vendor/laravel/framework/src/illuminate/cache/cachemanager.php(301): illuminate\cache\repository->rememberforever('thkt2r21aa1vlkh...', object(closure)) #3 /apppath/bootstrap/cache/compiled.php(6468): illuminate\cache\cachemanager->__call('rememberforever', array) #4 /apppath/vendor/eveseat/services/src/settings/settings.php(101): illuminate\support\facades\facade::__callstatic('rememberforever', array) #5 /apppath/vendor/eveseat/services/src/helpers/helpers.php(289): seat\services\settings\settings::get('main_character_...') #6 /apppath/vendor/package/mypackage/src/http/controllers/ts3controller.php(33): setting('main_character_...') #7 [internal function]: seat\ts3\http\controllers\ts3controller->getcontrols()
the offending function in ts3controller -
$apicharacterid = $pheal->evescope->characterid(array("names" => setting('main_character_name')));
the same call made elsewhere in parent package , still works, object still exists.
pheal not throwing errors , completing api calls elswhere.
the model being referenced -
namespace seat\services\settings; use seat\services\models\usersetting; /** * class profile. * @package seat\services\settings */ class profile extends settings { /** * options available setting type. * * @var array */ public static $options = [ 'sidebar' => ['sidebar-full', 'sidebar-collapse'], 'skins' => [ 'skin-blue', 'skin-black', 'skin-purple', 'skin-green', 'skin-red', 'skin-yellow', 'skin-blue-light', 'skin-black-light', 'skin-purple-light', 'skin-green-light', 'skin-red-light', 'skin-yellow-light', ], 'thousand_seperator' => [' ', ',', '.'], 'decimal_seperator' => [',', '.'], 'mail_threads' => ['yes', 'no'], ]; /** * @var string */ protected static $prefix = 'profile'; /** * @var */ protected static $model = usersetting::class; /** * @var string */ protected static $scope = 'user'; /** * @var array */ protected static $defaults = [ // ui 'sidebar' => 'sidebar-full', 'skin' => 'skin-black', 'language' => 'en', 'mail_threads' => 'yes', // main character 'main_character_id' => 1, 'main_character_name' => null, // numbers 'thousand_seperator' => ' ', 'decimal_seperator' => '.', // notifications 'email_notifications' => 'no', // multi factor authentication 'require_mfa' => 'no', ]; }
which referenced in controller here -
use seat\services\settings\profile;
Comments
Post a Comment