Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to get property of non-object #61

Closed
hifce opened this issue Dec 6, 2017 · 2 comments
Closed

Trying to get property of non-object #61

hifce opened this issue Dec 6, 2017 · 2 comments

Comments

@hifce
Copy link

hifce commented Dec 6, 2017

class FrontendController extends Controller
{
/**
* @return \Illuminate\View\View
*/
public function index()
{
$settingData = Setting::first();
$google_analytics = $settingData->google_analytics;

The last line throws this error:
Trying to get property of non-object.

This is a fresh install of laravel-adminpanel.

Thank you in advance!

Regards

@proofoftom
Copy link
Contributor

proofoftom commented Dec 6, 2017

Be sure that php artisan db:seed has run correctly. This should populate the settings table. I had an issue with running db:seed myself, hitting an error in EmailTemplatePlaceholderTableSeeder.

Seeding: EmailTemplatePlaceholderTableSeeder

In Connection.php line 664:

  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: truncate ``)


In PDOConnection.php line 79:

                'updated_at' => Carbon::now(),
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''


In PDOConnection.php line 77:

  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''

For the sake of testing, I commented out DB::table(config('module.email_templates.placeholder_table'))->truncate(); and DB::table(config('module.email_templates.placeholder_table'))->insert($data); in EmailTemplatePlaceholderTableSeeder.php.

Edit: See commit below for a proper solution.

@viralsolani
Copy link
Collaborator

Thanks, @TommyCox for resolving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants