husencoolwolf's avatar

How to print on blade with string format right way to use old url php params.

So, i use CKEditor and want pass variable from CKEditor Buildin Upload Adapter. code like this (its on blade template, on javascript line)

ClassicEditor
      .create(document.querySelector('#description'), {
        ckfinder: {
          uploadUrl: "{{ route('ckeditor.uploadImage') . '?_token=' . csrf_token() . '&slug=' . $experience->slug }}"
        }
      }
...

im expecting on url fetch xhr will like

url?_token=mytoken&slug=myslug

But i get this instead

url?_token=mytoken&slug=myslug

so how i to write right way ?

Thanks

0 likes
3 replies
Snapey's avatar

use the route helper

{{ route('ckeditor.uploadImage', ['_token'  =>csrf_token(), 'slug' =>$experience->slug]) }}
1 like
husencoolwolf's avatar

@Snapey It still got on rul xhr request on same problem. But i've found answer of my problem.

Thanks anyway sir. its additional referense for me

husencoolwolf's avatar
husencoolwolf
OP
Best Answer
Level 1

I've Found answer for my problem. so i write it like this :

          uploadUrl: "{{ route('ckeditor.uploadImage') . '?_token=' . csrf_token() }}&slug={{ $experience->slug }}"

it works perfecly. and got url parameters slug in normal way.

Please or to participate in this conversation.