-
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.
- Web > Fancybox v5.0 plugins eklendi. - php artisan make:controller Web/QualityController
- Loading branch information
1 parent
e79a520
commit 0e3f145
Showing
11 changed files
with
246 additions
and
9 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
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,25 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Web; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Models\Quality; | ||
|
||
class QualityController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
$records = Quality::query()->where('status', 1) | ||
->select(['id', 'title', 'slug', 'image', 'content']) | ||
->orderBy('created_at', 'desc')->orderBy('id', 'desc') | ||
->paginate(18); | ||
$records->each(function ($item) { | ||
$item->image_url = asset('storage/'.$item->image); | ||
}); | ||
$title = 'Qualities'; | ||
return view('web.quality.index', compact(['title', 'records'])); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,47 @@ | ||
@extends("layouts.web") | ||
@section("style") | ||
<link rel="stylesheet" href="{{ asset('assets/plugins/fancyapps/fancybox.css') }}"> | ||
@endsection | ||
@section("content") | ||
<div class="quality-page"> | ||
<div class="container container-page"> | ||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-6 g-3"> | ||
@if($records->total() > 0) | ||
@foreach($records as $item) | ||
<div class="col"> | ||
<div class="card shadow-sm"> | ||
<a href="{{ $item->image_url }}" data-fancybox="gallery" | ||
data-caption="{{ $item->content }}"> | ||
<img src="{{ $item->image_url }}" alt="{{ $item->title }}" class="card-img-top" | ||
width="100%" height="300"> | ||
<div class="card-body"> | ||
<p class="card-text">{{ $item->title }}</p> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
@endforeach | ||
@else | ||
<div class="alert alert-info">Not found</div> | ||
@endif | ||
@if($records->lastPage() > 1) | ||
<div class="col-12"> | ||
<div class="pagination"> | ||
{{ $records->links() }} | ||
</div> | ||
</div> | ||
@endif | ||
</div> | ||
</div> | ||
</div> | ||
@endsection | ||
@section("scripts") | ||
<script src="{{ asset('assets/plugins/fancyapps/fancybox.umd.js') }}"></script> | ||
<script> | ||
jQuery(function ($) { | ||
Fancybox.bind('[data-fancybox="gallery"]', { | ||
// Your custom options for a specific gallery | ||
}); | ||
}); | ||
</script> | ||
@endsection |
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