Voyager admin panel links are broken - laravel

What is my problem: I make application using Laravel 5.5. I want had my application url like www.example.com/shop, and navigation in dashboard voyager panel are broken. Links goes to www.example.com/admin/{slug} instead www.example.com/shop/admin/{slug}.
Iv tried already change prefix routes
Route::group(['prefix' => 'shop/admin'], function () {
Voyager::routes();
});
then navigation links goes to www.example.com/shop/{slug} but admin panel href change to www.example.com/shop/shop/...
I changed APP_URL to www.example.com/shop in env.
I won't change links using static href in menus builder cos many application use this same database.

I think your APP_URL should be www.example.com (without /shop). Try to run php artisan route:clear and php artisan route:list and see what URI's you get.

Related

Laravel voyager not showing full side menu

I am very new to laravel. After installing voyager (php artisan voyager:install) and migrating the database (php artisan migrate), the full menu of voyager is not shown (see attached)
Any advice/indication will be greatly appreciated.
The issue was related to the fact that I was calling the admin page of voyager using https. When I troied with http the dashboard menu was shown.

I can not create new Routes in Laravel project

I was developing a Full-Stack Laravel project using livewire and tailwind CSS in the front, everything was working just fine, I even did 5 commits on GitHub on this project. The problem is I came back to continue developing the project, and when I create new routes, Laravel returns 404 PAGE NOT FOUND, I even tried to test a very simple route, and it did not work too(404 page not found)
Route::get('/test', function () {
return 'hi';
});
Any solution to this weird problem?
Might be a chaching problem.
Try clear your cache by running
php artisan cache:clear
php artisan clear
You can also check all registered routes by running
php artisan route:list.
If thats not working it could also be a problem with the browsers internal cache. Had something like this before with Firefox.
Try using curl to access the endpoint
curl http://localhost:8080/test

There isn't displays authentication block in Laravel project

I'm completely new in Laravel. I don't understand why authentication block doesn't displays after I installed laravel/ui and php artisan make:auth command. These pages have been added. But there aren't any special routes in routes list. code
In web.php you have to use
Auth::routes();

Set Laravel Application Urls

Fairly new to Laravel here and I'm struggling to understand how to make Laravel 5.2 aware of where it resides. Here's the issue:
I set up auth using php artisan make:auth, and can now see the lovely landing page, as well as login and register links in the menu. The problem is that these links don't go to the right place. They point to /login and /register in the code respectively, which translates into http://localhost/login or http://localhost/register. But since I'm not on a production site yet and am developing locally, my website resides at http://localhost/projectname/public.
I've gone into config/app.php and tried various values for the URL parameter, but these have no effect.
What can I do to get these links to reflect the full site URL, without manually entering it each time?
you can run the development server in laravel using this command
php artisan serve
Did you try that?
Use laravel url function:
{{ url().'/login' }}

Laravel showing blank page

I just setup a Laravel 5 framework in my server by typing in terminal
laravel new blog (in "/var/www/html/" folder),
then changed the default config of Nginx so the root pointing to : root /var/www/html/blog/public;
of-course all the files are in place however I currently just see a blank page showing up ! I tried to put a html & PHP file in public folder and it all works fine. but not Laravel default index file. what am I missing here ?
For adding pages in Laravel you do not simply put files in /public. Please have a look at the official Laravel page if you want to create new views.
Laravel uses the MVC principle. So you need to have at least a view (the part which is displayed) and a controller which handles the view. To add a new Controller, please change to the project root cd /var/www/html/blog and type in php artisan controller:make AwesomeController which creates the controller in app/Http/Controllers/AwesomeController.php.
In this Controller you can simply return a view by adding return view('myview') to the index() Method for example. (The view has to exist at resources/views/myview.blade.php of course)
In the last step you need to tell Laravel how to call your controller. Please modify the routes.php file at app/Http/routes.php and add Route::get('foo', 'AwesomeController');. Now you need to tell composer that some of your controllers may have changed and composer needs to refresh the cache. Type in composer dump-autoload and start the development server php artisan serve.
By calling http://localhost:8000/foo (by default) you should see your View. Have a nice day!

Resources