Search code examples
phplaravelvoyager

No hint path defined for [voyager ]


I'm trying to create a custom admin page and Menu in Laravel Voyager.

This is the error that I'm getting.

ErrorException (E_ERROR)
No hint path defined for [voyager ]. (View: /Users/jake/code/DS/resources/views/vendor/voyager/orders/order.blade.php)

This is my web.php file

Route::get('/', function () {
    return view('welcome');
});


Route::group(['prefix' => 'admin'], function () {
    Voyager::routes();
});

Route::get('/admin/orders', function () {
    return view('vendor/voyager/orders/order');
});

This is my resources/views/vendor/voyager/orders/order.php

@extends ('voyager::master')

@section('content')
    <h1>Hello There</h1>
@stop

When I add TCG\Voyager\VoyagerServiceProvider::class, to app.php it displays the page but other things like $dataTypeContent don't work. I'm using Laravel 5.6 whereby I thought Voyager is auto-discovered. Am I doing something wrong?

Any Help would be great.

Thanks, Jake.


Solution

  • I believe the error is coming from this route:

    Route::get('/admin/orders', function () {
        return view('vendor/voyager/orders/order');
    });
    

    Try changing the return to:

    return view('voyager::orders.order');
    

    Another thing, resources/views/vendor/voyager/orders/order.php is missing the blade portion, so resources/views/vendor/voyager/orders/order.blade.php