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
  • 5,799
  • 11
  • 40
  • 45
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,331
  • 17
  • 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
  • 32,743
  • 20
  • 155
  • 172