If the save fails, this is the code
1 |
|
If the save is successful, how to return if there is a template?
1 |
|
Or a prompt of success appears in the template
1 |
|
================================================ ===============================
router:
1 2 3 4 5 6 7 |
|
Controller
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
Template page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
某草草2017-05-16 16:57:22
First of all, my personal understandingredirect()
并不是redirect('/模板')
,而是redirect('/routePath')
, if you want to use it like this, for example, implement the following jump:
1 |
|
The general process is like this, first you have to register your route in routes.php
, for example:
1 2 |
|
Then the UsersController
的storeSuccess
method usually has the following statement:
1 |
|
Finally, you can use a statement similar to the following in success.blade.php
to get the jump information:
1 2 3 4 5 |
|
The status
就是最开始redirect()->with()
中的status
,理解为key
。用session
取这个key
here is fine
Finally, if you want to learn laravel, you can check out the community I just launched. There are a series of articles and tutorials here, and I will try to record videos later:
Link---》Laravist
Happy Hacking