G
G
garskiy-pavel2015-10-28 00:06:34
Laravel
garskiy-pavel, 2015-10-28 00:06:34

I upload an image using CKEditor, Laravel 5.1 swears at the lack of a csrf token. How to add a token to a request?

I upload an image using CKEditor, Laravel 5.1 swears at the lack of a csrf token.
How to add a token to a request?9437fde90358409a8d4872c4753f4be5.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tridcatij, 2015-10-28
@tridcatij

Add to views
If the request is via ajax, then add this:
P.S.
Just call ajaxSetup before CKEditor:

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="js/config.js"></script> <!-- сюда вставляем $.ajaxSetup (не забываем обернуть в $(function () {...});) -->
<script src="js/ckeditor.js"></script>

J
javanub, 2015-10-28
@javanub

Can be added to the form

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question