1 year ago

Form not submitting

Posted 1 year ago by TimeSocks

Hi there,

I'm encountering a very strange problem while going through the Birdboard series. I have made a simple form for creating a project as per episode 7:

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <meta charset="utf-8">
    <h1>Create a project</h1>
    <form action="/projects" method="post">
      <input type="text" name="title" value="">
      <input type="text" name="description" value="">
      <button type="button" name="button" type="submit">Submit</button>

This just doesn't submit. I click the button and nothing happens. I have tried a dd in the relevant method in the controller, but it never triggers, like it's not even getting that far. FWIW here is the store() method:

public function store()
      $attributes = request()->validate([
        'title' => 'required',
        'description' => 'required',


      return redirect('/projects');

And the route file:

Route::group(['middleware' => 'auth'], function(){
  Route::get('/projects/create', '[email protected]');
  Route::get('/projects/{project}', '[email protected]');
  Route::get('/projects', '[email protected]');
  Route::post('/projects', '[email protected]');
  Route::get('/home', '[email protected]')->name('home');

What gives?

Please sign in or create an account to participate in this conversation.