samedi 19 août 2017

Laravel laracast/utilities not working

So I just have a freshly installed project with laravel valet, using laravel 5.4. Running the following commands in the exact order.

npm install
composer require laracasts/utilities
php artisan vendor:publish

Now I edit the config/app.php and add

'Laracasts\Utilities\JavaScript\JavaScriptServiceProvider'

to the end of the list.

Next I edit my routes/web.php to do a quick test and edit it to the following

use Javascript;
Route::get('/', function () {
    Javascript::put([
        'foo' => 'bar',
        'user' => 'My sweet user',
        'age' => 29
    ]);
    return view('welcome');
});

Now I also published the config and edited it to run on the welcome page instead of the footer.

Now I get the following error:

The use statement with non-compound name 'Javascript' has no effect



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2fUZLIg
via IFTTT

Aucun commentaire:

Enregistrer un commentaire