This repository was archived by the owner on Jan 28, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-26
lines changed Expand file tree Collapse file tree 3 files changed +17
-26
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- /*
4
- |--------------------------------------------------------------------------
5
- | Routes File
6
- |--------------------------------------------------------------------------
7
- |
8
- | Here is where you will register all of the routes in an application.
9
- | It's a breeze. Simply tell Laravel the URIs it should respond to
10
- | and give it the controller to call when that URI is requested.
11
- |
12
- */
13
-
14
3
/*
15
4
|--------------------------------------------------------------------------
16
5
| Application Routes
26
15
use Illuminate \Http \Request ;
27
16
28
17
Route::group (['middleware ' => ['web ' ]], function () {
29
-
30
18
/**
31
19
* Show Task Dashboard
32
20
*/
43
31
$ validator = Validator::make ($ request ->all (), [
44
32
'name ' => 'required|max:255 ' ,
45
33
]);
34
+
46
35
if ($ validator ->fails ()) {
47
36
return redirect ('/ ' )
48
37
->withInput ()
49
38
->withErrors ($ validator );
50
39
}
40
+
51
41
$ task = new Task ;
52
42
$ task ->name = $ request ->name ;
53
43
$ task ->save ();
44
+
54
45
return redirect ('/ ' );
55
46
});
56
47
59
50
*/
60
51
Route::delete ('/task/{id} ' , function ($ id ) {
61
52
Task::findOrFail ($ id )->delete ();
53
+
62
54
return redirect ('/ ' );
63
55
});
64
56
});
Original file line number Diff line number Diff line change 29
29
<div class =" form-group" >
30
30
<div class =" col-sm-offset-3 col-sm-6" >
31
31
<button type =" submit" class =" btn btn-default" >
32
- <i class =" fa fa-plus" ></i >Add Task
32
+ <i class =" fa fa-btn fa- plus" ></i >Add Task
33
33
</button >
34
34
</div >
35
35
</div >
62
62
{{ method_field (' DELETE ' ) } }
63
63
64
64
<button type =" submit" class =" btn btn-danger" >
65
- <i class =" fa fa-trash" ></i >Delete
65
+ <i class =" fa fa-btn fa- trash" ></i >Delete
66
66
</button >
67
67
</form >
68
68
</td >
You can’t perform that action at this time.
0 commit comments