1

I am very new in Laravel and PHP and hope that somebody can help me.

I want to add this code:

<?php

    $atts = array(
        "id" => 3,
        "post_id" => $actor['id'],
    );
    rating_form( $atts );
?>

to Laravel blade view and I'm get this exception:

Symfony \ Component \ Debug \ Exception \ FatalErrorException
Call to undefined function rating_form()
IKavanagh
  • 6,089
  • 11
  • 42
  • 47
johnvoice
  • 11
  • 2

2 Answers2

0

It's not a good way to include files in laravel. Change your composer file to load this file:

"autoload": {
    "psr-4": {
        ...
     },
     "files": [
        "rating-form/inc.php"
     ]
}

Then run composer dump-autload.

Iamzozo
  • 2,341
  • 18
  • 21
0

try

php artisan queue:restart

the queue may have cached some of your source code (liek your helpers) and when you add new function, you need to restart the queue

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191