-
Notifications
You must be signed in to change notification settings - Fork 76
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
defaultLocation not modified in edit page or view page #102
Comments
Did you end up finding a solution? |
I ended up needing this on my model: protected $appends = [
'location',
]; |
@sstottelaar Did you guys find any solution? |
Didn't work with me still getting error location is not afield in your database. |
Same issue :( |
Until that is merged, if anyone is looking for a quick fix then extend the component and put that fix in. Remember to change your form field to use your class. <?php
namespace App\Forms\Components;
use Exception;
class Map extends \Cheesegrits\FilamentGoogleMaps\Fields\Map
{
public function getState(): mixed
{
$state = parent::getState();
if (is_array($state)) {
if (empty(array_filter($state))) {
return $this->getDefaultLocation();
}
return $state;
} else {
try {
return @json_decode($state, true, 512, JSON_THROW_ON_ERROR);
} catch (Exception $e) {
return $this->getDefaultLocation();
}
}
}
} |
Hey there. I've merged the PR associated with this issue onto my fork so we can all get all these goodies from a single place. I gave credits to the person who made the PR in the commits, changelog and in the releases. I'm open to suggestions on how to move forward from here, simply open up an issue in my fork so we can chat about it. |
Hello ,
i have this issue that defaultLocation not modified to my new location , still marker appear in a default location not my new location that i saved.
The text was updated successfully, but these errors were encountered: