Use the correct place URL format
This commit is contained in:
parent
976b9ac00f
commit
e3f398ff84
1 changed files with 3 additions and 3 deletions
|
@ -42,9 +42,9 @@ class NoteService
|
||||||
|
|
||||||
if ($place !== null && $place !== 'no-location') {
|
if ($place !== null && $place !== 'no-location') {
|
||||||
if (substr($place, 0, strlen(config('app.url'))) == config('app.url')) {
|
if (substr($place, 0, strlen(config('app.url'))) == config('app.url')) {
|
||||||
//uri of form http://host/place/slug, we want slug so chop off start
|
//uri of form http://host/places/slug, we want slug so chop off start
|
||||||
//that’s the app’s url plus `/place/`
|
//that’s the app’s url plus `/places/`
|
||||||
$slug = mb_substr($place, mb_strlen(config('app.url')) + 7);
|
$slug = mb_substr($place, mb_strlen(config('app.url')) + 8);
|
||||||
$placeModel = Place::where('slug', '=', $slug)->first();
|
$placeModel = Place::where('slug', '=', $slug)->first();
|
||||||
$note->place()->associate($placeModel);
|
$note->place()->associate($placeModel);
|
||||||
$note->save();
|
$note->save();
|
||||||
|
|
Loading…
Add table
Reference in a new issue