-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Models\Item; | ||
|
||
class ItemController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$items = Item::all(); | ||
return view('items.index', ['items' => $items]); | ||
} | ||
|
||
public function show($id) | ||
{ | ||
$item = Item::find($id); | ||
return view('items.show', ['item' => $item]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<h1>出品商品一覧</h1> | ||
<ul> | ||
@foreach ($items as $item) | ||
<a href="/items/{{ $item->id }}"> | ||
<li>{{ $item->name }}</li> | ||
</a> | ||
@endforeach | ||
</ul> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<p> | ||
<b>商品名:{{ $item->name }}</b> | ||
</p> | ||
<p> | ||
<b>商品詳細:{{ $item->description }}</b> | ||
</p> | ||
<p> | ||
<b>価格:{{ $item->price }}</b> | ||
</p> | ||
<p> | ||
<b>出品者:{{ $item->seller }}</b> | ||
</p> | ||
<p> | ||
<b>電子メール:{{ $item->email }}</b> | ||
</p> | ||
<p> | ||
<img src="{{ $item->image_url }}" alt=""> | ||
</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |