Skip to content

Commit

Permalink
bootstrap catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
yelypk committed Aug 26, 2024
1 parent 41de6d4 commit 47e3347
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/Http/Controllers/CatalogController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App\Http\Controllers;

use Illuminate\View\View;
use App\Models\Info;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

class CatalogController extends Controller
{
/**
* Show the profile for a given user.
*/
public function index(): View
{

$goods = Info::all();

return view('catalog', [
])->with('goods', $goods);
}
}
31 changes: 31 additions & 0 deletions resources/views/catalog.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">



</head>
<body>
<h1>editing of good</h1>
<div class="row" data-masonry='{"percentPosition": true }'>
@foreach ($goods as $good)
<div class="col-sm-6 col-lg-4 mb-4">
<div class="card">
<img src="{{$good->image}}$" class="card-img-top" alt="{{$good->name}}$">
<div class="card-body">
<h5 class="card-title">{{$good->name}}</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">price:{{$good->price}}$</h6>
<p class="card-text">{{$good->description}}$</p>
</div>
</div>
</div>
@endforeach
</div>


<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous" async></script>
</body>
</html>


3 changes: 3 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
Route::post('/login', [LoginController::class, 'indexpath']);
Route::get('/logout', [LoginController::class, 'logout']);

use App\Http\Controllers\CatalogController;
Route::get('/catalog', [CatalogController::class, 'index']);

Route::get('/foo', function () {
return view('listofgoods');
});

0 comments on commit 47e3347

Please sign in to comment.