Chandraarnav
Chandraarnav

Reputation: 87

How to link a HTML page to a button in Laravel 5.1. I am new to PHP very new to Laravel and this community

I am trying to link a separate signup page with the signup button using laravel, it's showing:

NotFoundHttpException in RouteCollection.php line 161:error

The page resides in the resources/views folder. And the html in in resources/views/includes.

Upvotes: 1

Views: 3670

Answers (3)

Chandraarnav
Chandraarnav

Reputation: 87

got answer to my problem.

The routes.php should have:

    Route::get('/signup', function () {return view('actions.firstsignup');})->name('firstsignup');

here '/signup' is the http identity for the page. 'actions' is the sub-folder in views where the destination file is stored, file-name is firstsignup.blade.php and ->name('firstsignup') is route definition.

Now I have put link in the button as:

    href="{{route('firstsignup')}} 

Thanks a lot guys for helping me clearing it conceptually.

Upvotes: 0

Danyal Sandeelo
Danyal Sandeelo

Reputation: 12401

The URL of your sign-up page is not added in the routes.php file, add it in the file as:

Route::get('/signup','yourController@sign_up_function');

Upvotes: 0

Komal
Komal

Reputation: 2736

http/routes.php

Route::get('/register', 'HomeController@getRegister');

Controllers/HomeController.php

public function getRegister() 
{
    return view('admin.register');   
}

Upvotes: 1

Related Questions