Skip to content

Instantly share code, notes, and snippets.

@tommymarshall
Last active August 29, 2015 14:13
Show Gist options
  • Save tommymarshall/e90112157a8d76c6d4f1 to your computer and use it in GitHub Desktop.
Save tommymarshall/e90112157a8d76c6d4f1 to your computer and use it in GitHub Desktop.
Route::post() requests never get matched, requests always end up matching Route::get(). Here's a gif of what's happenning: http://cl.ly/image/3s0X0q2p0r1o
<?php
class PagesController extends BaseController
{
public function home() {
return View::make("pages.home");
}
public function about() {
return View::make("pages.about");
}
public function vision() {
return View::make("pages.vision");
}
public function subscription() {
return View::make("pages.subscription");
}
public function create() {
die(var_dump(Input::all()));
exit;
}
}
<?php
// Home
Route::get('home', 'PagesController@home');
// Pages
Route::get('page', [['about'], 'uses' => 'PagesController@about']);
Route::get('page', [['vision'], 'uses' => 'PagesController@vision']);
Route::get('page', [['subscription'], 'uses' => 'PagesController@subscription']);
// Subscription
Route::post('page', [['subscription'], 'uses' => 'PagesController@create']);
@extends('layouts.base')
@section('content')
<h1>Subscribe</h1>
{{ Form::open('subscription') }}
Name: <input type="text" name="name" id="name"><br>
Email: <input type="email" name="email" id="email"><br>
<input type="submit" value="Submit">
{{ Form::close() }}
@stop
@tommymarshall
Copy link
Author

That did it :) Awesome! Thank you.

@jlambe
Copy link

jlambe commented Jan 14, 2015

Great 😄 A 1.1.1 minor update should be available for the end of the week so you'll be up to date for using the framework on your projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment