MyHomeCollection/resources/views/public/list.blade.php

40 lines
1.7 KiB
PHP
Raw Permalink Normal View History

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card">
<div class="card-header">{{ __('List') }}</div>
<div class="card-body">
<div class="row">
@if(count($homes) > 0)
@foreach($homes as $home)
<div class="col-sm-4">
<div class="card">
<img class="card-img-top" src="{{ asset($home->pictures[0]) }}">
<div class="card-body">
<h5 class="card-title">
{{ $home->title }}
<small class="badge badge-@if($home->price <= 100000)primary @elseif($home->price <= 200000)success @else()warning @endif">{{ Str::currency($home->price) }}</small>
</h5>
<p class="card-text">{{ $home->excerpt() }}</p>
<a href="{{ route('public.view', ['slug' => $home->slug]) }}" class="btn btn-primary">Voir la maison</a>
</div>
</div>
</div>
@endforeach
<div class="col-sm-12 mt-4">
{{ $homes->links() }}
</div>
@else
Aucune maison publique :(
@endif
</div>
</div>
</div>
</div>
</div>
</div>
@endsection