title: new to CRUD in Laravel 5
body: <p>I'm very new to Laravel 5. I'm currently doing a task project with CRUD functions. I did the delete function, but update and add are still messy. Please help me.</p>
  
  <p>My database has only 1 table, 'tasks' with 3 columns: id, name and day. </p>
  
  <pre><code>My TaskModel:
  
  &lt;?php namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class TasksModel extends Model {
  
      //
      protected $table = 'tasks';
  
  }
  </code></pre>
  
  <p>Here is my home view:</p>
  
  <pre><code>&lt;html&gt;
  &lt;header&gt;
      &lt;style&gt;
          .wrapper{
              width:600px;
              margin:auto;
          }
  
      &lt;/style&gt;
      &lt;title&gt;Tasks List&lt;/title&gt;
  
  &lt;/header&gt;
  
  &lt;body&gt;
  &lt;div class="wrapper"&gt;
  
      &lt;h2 align="center"&gt;&lt;font color="#a52a2a"&gt;Task List&lt;/font&gt;&lt;/h2&gt;
      &lt;table name ="todo_table" border="1px" cellspacing="0" width = "600px"&gt;
          &lt;tr align="center"&gt;
              &lt;td&gt;ID&lt;/td&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;Time&lt;/td&gt;
              &lt;td&gt;Action&lt;/td&gt;
          &lt;/tr&gt;
  &lt;?php
  
          $records = \App\TasksModel::all()-&gt;sortBy('id');
          foreach($records as $mytask)
  
          {
  
  
  ?&gt;
  
              &lt;tr align="center"&gt;
  
                  &lt;td&gt;&lt;?php echo $mytask-&gt;id; ?&gt;&lt;/td&gt;
                  &lt;td width="200px"&gt;&lt;?php echo $mytask-&gt;name; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $mytask-&gt;day; ?&gt;&lt;/td&gt;
                  &lt;td width="100px"&gt;
                      &lt;a href = "{{ URL::to('add') }}"&gt; &lt;img src = "/public/images/add.jpg" width="30px" height="30px"&gt; &lt;/a&gt;
                      &lt;a href = "{{ URL::to('delete' . '/id='. $mytask-&gt;id ) }}"&gt; &lt;img src = "/public/images/del.jpg" width="30px" height="`30px"&gt; &lt;/a&gt;
                      &lt;a href = "{{ URL::to('update' . '/id='. $mytask-&gt;id ) }}"&gt; &lt;img src = "/public/images/update.jpg" width="30px" height="30px"&gt; &lt;/a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  &lt;?php
  
          }// End of foreach($records as $mytask)
  
  ?&gt;
      &lt;/table&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's my Add view:</p>
  
  <pre><code>   &lt;html&gt;
      &lt;head&gt;
          &lt;style&gt;
              .wrapper{
                  width:600px;
                  margin:auto;
              }
  
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;div&gt;
  
          {!! Form::open(array('url' =&gt; 'process', 'method' =&gt; 'post')) !!}
          &lt;div class="wrapper"&gt;
              &lt;h2&gt;&lt;font color="#a52a2a"&gt;Add Task&lt;/font&gt;&lt;/h2&gt;
  
              &lt;p&gt;&lt;input type = "text" name = "new-task" placeholder = "Add  new task..." /&gt;&lt;/p&gt;
              &lt;p&gt;&lt;input type = "text" name = "new-time" placeholder = "Add  new time..." /&gt;&lt;/p&gt;
              {!! Form::submit('Add', array('name' =&gt; 'bt_add')) !!}
  
  
          &lt;/div&gt;
  
          {!! Form::close() !!}
      &lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>My Route:</p>
  
  <pre><code>Route::get('/', 'HomeController@index');
  
  Route::get('add', 'HoneController@add');
  
  Route::get('delete/id={del}', 'HomeController@delete');
  
  Route::get('update/id={edit}', 'HomeController@update');
  
  Route::get('process', 'ProcessController@index'); // I think process page will handle update/add
  </code></pre>