skip to Main Content

This is my first time asking questions in StackOverflow so sorry for the mistakes.
I have a problem with laravel routes.

    <?php
use IlluminateSupportFacadesRoute;
//start :: login
Route::group(['namespace' => 'auth'], function () {
    Route::get('/', 'AuthController@index')->name('index');
    Route::get('/showResult', 'AuthController@Result')->name('Result');
    Route::post('/showResultds', 'AuthController@showResult')->name('showResult');
    Route::post('/dologin', 'AuthController@doLogin')->name('doLogin');
    Route::get('/logout', 'AuthController@logout')->name('logout');

So these are my routes.
I have determined the app URL correctly in .env file.

My problem is that when my website is on the server (windows server) the route becomes the server’s local IP address and not my domain or public IP address.
When I click on my links it becomes 172.30.30.4/login for example. and not domainname.com/login

Thanks for your help

2

Answers


  1. When changing anything in any of the config files or the .env you should always run

    php artisan config:cache
    

    This will clear your current cache and cache your new settings

    Login or Signup to reply.
  2. change the url in your config/app.php

    'url' => env('APP_URL', 'http://localhost'),
    

    and dont forget to run php artisan config:cache

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search