How to combine multiple fields into one? Address field
Hi, my model has:
$table->string('name');
$table->string('email')->nullable()->unique();
$table->string('phone')->nullable();
$table->string('address')->nullable();
$table->integer('number')->nullable();
$table->string('city')->nullable();
$table->string('state')->nullable();
So, I need to have a searchable TextColumn with the field concatenated like:
4 Pennsylvania Plaza, New York, NY 10001, EE. UU.
I've tryed to create an attirbute
public function getFulladdressAttribute() : string {
return $this->address.' '.$this->number.' '.$this->city', '.$this->state;
}
but it's not found in the database.
Thanks
$table->string('name');
$table->string('email')->nullable()->unique();
$table->string('phone')->nullable();
$table->string('address')->nullable();
$table->integer('number')->nullable();
$table->string('city')->nullable();
$table->string('state')->nullable();
So, I need to have a searchable TextColumn with the field concatenated like:
4 Pennsylvania Plaza, New York, NY 10001, EE. UU.
I've tryed to create an attirbute
public function getFulladdressAttribute() : string {
return $this->address.' '.$this->number.' '.$this->city', '.$this->state;
}
but it's not found in the database.
Thanks