8000 come back to · dynamic2code/laravel_example@50763f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 50763f0

Browse files
committed
come back to
1 parent 4cb8d1d commit 50763f0

File tree

6 files changed

+57
-7
lines changed

6 files changed

+57
-7
lines changed

app/Http/Controllers/Home.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class Home extends Controller
8+
{
9+
public function index(){
10+
return view('welcome');
11+
}
12+
}

app/Http/Controllers/Items.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class Items extends Controller
8+
{
9+
public function show_items(){
10+
$item = [
11+
'item_name' => $name,
12+
'quantity'=> $quantity,
13+
'price' => $price
14+
];
15+
return view('shopping_list',$item);
16+
}
17+
}

app/Http/Controllers/cart.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class cart extends Controller
8+
{
9+
//
10+
}

app/Http/Controllers/user.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class user extends Controller
8+
{
9+
//
10+
}

resources/views/shopping_list.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
</div>
3737
@endif
3838

39-
39+
<div class="item_raw">
40+
<div id="name">{{$name}}</div>
41+
<div id="price"> {{$price}}</div>
42+
A8ED <div id="quantity">{{$quantity}}</div>
43+
</div>
4044
</div>
4145
</body>
4246
</html>

routes/web.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
|
1414
*/
1515

16-
Route::get('/', function () {
17-
return view('welcome');
18-
});
19-
Route::get('/shopping_list', function () {
20-
return view('shopping_list');
21-
});
16+
Route::get('/', 'Home@index');
17+
18+
Route::get('/shopping_list', 'Item@show_items');

0 commit comments

Comments
 (0)
0