0

I am new to laravel and this will be inappropriate question. Although I searched I couldn't find the answer. My project run smoothly with php artisan serve command. I just wanted to remove the artisan command. So I added my project into htdoc folder of XAMPP. Then I changed according to this answer

https://stackoverflow.com/a/28799205/3558507

When I run my project by typing URL on chrome as "http://localhost/MonitorEnto/public/home" home page is appearing. But when I tried to navigate through links and tabs its not working, URL is showing in my browser as "http://localhost/add_company".

I changed config/app.php line as 'url' => env('APP_URL', 'http://localhost/MonitorEnto/public/'), But still problem is there. Please help me to solve this matter. Thanks/

mare96
  • 3,749
  • 1
  • 16
  • 28

2 Answers2

1

You have to change navigation menu as you declared in route. Check you route file and add proper route name in respective menu. Hope this will solve your issue. And you should link up style/scripts file properly.

Suppose for home:

Route::get('/home', 'HomeController@index')->name('home');

You can call in blade file {{ route('home') }} or defined url as {{ url('/home') }}.

Chonchol Mahmud
  • 2,717
  • 7
  • 39
  • 72
0

step-1 :Go to your Project folder in public folder Exampale: path = yourproject/public/

Step-2 :copy 2 files index.php and .htaccess paste in your project root folder

Step-3 :open index.php file and modfy this code

require DIR.'/../vendor/autoload.php'; //change to this path require DIR.'/vendor/autoload.php';

/* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */

$app = require_once DIR.'/../bootstrap/app.php'; //change to this path $app = require_once DIR.'/bootstrap/app.php';

step-4 :Open file yourproject\app\routes\web.php add this route

Route::get('/home', 'HomeController@index');

Step-5 : run this url in your locahost http://localhost/yourproject/home