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

@ -1,16 +1,5 @@
<?php <?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 | Application Routes
@ -26,7 +15,6 @@ use App\Task;
use Illuminate\Http\Request; use Illuminate\Http\Request;
Route::group(['middleware' => ['web']], function () { Route::group(['middleware' => ['web']], function () {
/** /**
* Show Task Dashboard * Show Task Dashboard
*/ */
@ -43,14 +31,17 @@ Route::group(['middleware' => ['web']], function () {
$validator = Validator::make($request->all(), [ $validator = Validator::make($request->all(), [
'name' => 'required|max:255', 'name' => 'required|max:255',
]); ]);
if ($validator->fails()) { if ($validator->fails()) {
return redirect('/') return redirect('/')
->withInput() ->withInput()
->withErrors($validator); ->withErrors($validator);
} }
$task = new Task; $task = new Task;
$task->name = $request->name; $task->name = $request->name;
$task->save(); $task->save();
return redirect('/'); return redirect('/');
}); });
@ -59,6 +50,7 @@ Route::group(['middleware' => ['web']], function () {
*/ */
Route::delete('/task/{id}', function ($id) { Route::delete('/task/{id}', function ($id) {
Task::findOrFail($id)->delete(); Task::findOrFail($id)->delete();
return redirect('/'); return redirect('/');
}); });
}); });

23
composer.lock generated

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

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

Loading…
Cancel
Save