master
Taylor Otwell 10 years ago
parent 1c229dfa99
commit 33edcabd36

@ -1,16 +1,5 @@
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
|--------------------------------------------------------------------------
| Application Routes
@ -26,7 +15,6 @@ use App\Task;
use Illuminate\Http\Request;
Route::group(['middleware' => ['web']], function () {
/**
* Show Task Dashboard
*/
@ -43,14 +31,17 @@ Route::group(['middleware' => ['web']], function () {
$validator = Validator::make($request->all(), [
'name' => 'required|max:255',
]);
if ($validator->fails()) {
return redirect('/')
->withInput()
->withErrors($validator);
}
$task = new Task;
$task->name = $request->name;
$task->save();
return redirect('/');
});
@ -59,6 +50,7 @@ Route::group(['middleware' => ['web']], function () {
*/
Route::delete('/task/{id}', function ($id) {
Task::findOrFail($id)->delete();
return redirect('/');
});
});

23
composer.lock generated

@ -308,16 +308,16 @@
},
{
"name": "laravel/framework",
"version": "v5.2.19",
"version": "v5.2.20",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "0eb6a77aa12b305300a2483778edcf4c7086cb78"
"reference": "d4ff9a1e3e9b2f99f8f3e957876e343d804d944f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/0eb6a77aa12b305300a2483778edcf4c7086cb78",
"reference": "0eb6a77aa12b305300a2483778edcf4c7086cb78",
"url": "https://api.github.com/repos/laravel/framework/zipball/d4ff9a1e3e9b2f99f8f3e957876e343d804d944f",
"reference": "d4ff9a1e3e9b2f99f8f3e957876e343d804d944f",
"shasum": ""
},
"require": {
@ -432,20 +432,20 @@
"framework",
"laravel"
],
"time": "2016-02-17 19:33:49"
"time": "2016-02-19 17:58:28"
},
{
"name": "league/flysystem",
"version": "1.0.16",
"version": "1.0.17",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "183e1a610664baf6dcd6fceda415baf43cbdc031"
"reference": "02f5b6c9a8b9278c8381e3361e7bd9d641c740ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/183e1a610664baf6dcd6fceda415baf43cbdc031",
"reference": "183e1a610664baf6dcd6fceda415baf43cbdc031",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/02f5b6c9a8b9278c8381e3361e7bd9d641c740ca",
"reference": "02f5b6c9a8b9278c8381e3361e7bd9d641c740ca",
"shasum": ""
},
"require": {
@ -458,8 +458,7 @@
"ext-fileinfo": "*",
"mockery/mockery": "~0.9",
"phpspec/phpspec": "^2.2",
"phpspec/prophecy-phpunit": "~1.0",
"phpunit/phpunit": "~4.8"
"phpunit/phpunit": "~4.8 || ~5.0"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
@ -516,7 +515,7 @@
"sftp",
"storage"
],
"time": "2015-12-19 20:16:43"
"time": "2016-02-19 15:35:38"
},
{
"name": "monolog/monolog",

@ -29,7 +29,7 @@
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
<button type="submit" class="btn btn-default">
<i class="fa fa-plus"></i>Add Task
<i class="fa fa-btn fa-plus"></i>Add Task
</button>
</div>
</div>
@ -62,7 +62,7 @@
{{ method_field('DELETE') }}
<button type="submit" class="btn btn-danger">
<i class="fa fa-trash"></i>Delete
<i class="fa fa-btn fa-trash"></i>Delete
</button>
</form>
</td>

Loading…
Cancel
Save