Probably you have a wrong value in you're view path?
// view.php
'paths' => array(__DIR__.'/../../public'),
Вопрос
I'm making web app using Laravel and AngularJS. To prevent CSRF, I added following script to index.php file.
<script>
angular.module("contactApp").constant("CSRF_TOKEN", '<?php echo csrf_token(); ?>');
</script>
But it shows the following Fatal error.
"Call to undefined function csrf_token()"
In Laravel setting, I changed the View Storage Paths in view.php to public_html folder. It seems it makes the error. How I can solve this problem with using an alternative View Storage Paths?
Решение
Probably you have a wrong value in you're view path?
// view.php
'paths' => array(__DIR__.'/../../public'),
Другие советы
To get a CSRF token in Laravel the code is:
<?php echo Form::token(); ?>
or if your using Blade templates:
{{ Form::token() }}