1313|
1414*/
1515
16- Route::get ('/ ' , function () {
17- return view ('welcome ' );
18- });
16+ // Route::view('/', 'welcome');
17+
18+ // Route::get('test', function() {
19+ // $name = request('name');
20+ // return view('test', [
21+ // 'name' => $name
22+ // ]);
23+ // });
24+
25+ // Route::get('/phpinfo', function () {
26+ // return view("phpinfo");
27+ // });
28+
29+ // Route::get('/jsonArr', function() {
30+ // return ['Name' => 'Luke'];
31+ // });
32+
33+ // Route::get('/service1', function() {
34+ // $name = request('name');
35+ // return $name;
36+ // });
37+
38+ // Route::get('/', 'NameController@requestAsJson');
39+
40+ // Route::get('/posts/{post}', function($post) {
41+ // $posts = [
42+ // 'my-first-post' => 'Hello, this is my first blog post!',
43+ // 'my-second-post' => 'Now I am getting the hang of this blogging thing.'
44+ // ];
45+
46+ // if(! array_key_exists($post, $posts))
47+ // {
48+ // abort(404, 'Sorry that post was not found.');
49+ // }
50+
51+ // return view('post', [
52+ // 'post' => $posts[$post] ?? 'Nothing here yet.'
53+ // ]);
54+ // });
55+
56+
57+ Route::get ('/posts/{post} ' , 'PostController@show ' );
0 commit comments