Lecturize / Laravel-Addresses

Simple address and contact management for Laravel.
MIT License
197 stars 39 forks source link

Updated __construct #9

Closed DanielBoettner closed 6 years ago

DanielBoettner commented 7 years ago

Added $attributes array

It seems there is an compatibility issue with Laravel 5.4 (maybe other versions as well).

The addresses where created with empty values.

I suspected that it is the same problem as this.

I tested the solution and it worked for me. The change as seen in the link is simply changing this:

    public function __construct()
    {
        parent::__construct();
        $this->table = config('lecturize.addresses.table', 'addresses');
    }

to this:

    public function __construct(array $attributes = array())
    {
        parent::__construct($attributes);
        $this->table = config('lecturize.addresses.table', 'addresses');
    }

A colleague mentioned ( I do not have any link so far to support this claim) that things like this should be handled in boot and not constuct anymore.

So maybe there even is a more up to date method to pass the attributes.

AlexanderPoellmann commented 6 years ago

Thanks for the fix!