%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/evablog/resources/views/
Upload File :
Create Path :
Current File : /var/www/html/evablog/resources/views/posts.blade.php

@extends('layouts.app')

@section('content')
    <div class="posts-container">
        <form method="GET" autocomplete="off" action="{{ route('dashboard.posts') }}" novalidate>
            <div class="form-group row">
                <div class="col-md-3">
                    <input type="text" class="form-control" placeholder="Title" id="title" name="title"
                           value="{{array_key_exists('title', $params) ? $params['title'] : ''}}">
                </div>
                <div class="col-md-3">
                    <select type="text" class="form-control" id="category_id" name="category_id">
                        <option value="">Category</option>
                        @foreach($categories as $category)
                            <option value="{{$category->id}}" {{array_key_exists('category_id', $params) && $params['category_id'] == $category->id ? 'selected' : ''}} >{{$category->name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6">
                    <button class="btn btn-outline-primary">Search</button>
                    <a class="btn btn-outline-primary" href="{{route('dashboard.posts.details', 'new')}}">
                        Create
                    </a>
                </div>
                <div class="col-md-6">
                    {{ $posts->links('pagination::bootstrap-4') }}
                </div>
            </div>
        </form>

        <div class="row">
            <div class="col-md-12">
                <table class="table">
                    <thead>
                    <th width="20%">Image</th>
                    <th>Title</th>
                    <th>Description</th>
                    <th class="text-right">Actions</th>
                    </thead>
                    <tbody>
                    @foreach($posts as $post)
                        <tr>
                            <td>
                                <img src="{{$post->media()->first()->getUrl()}}" class="img-fluid">
                            </td>
                            <td>{{$post->title}}</td>
                            <td>{{$post->description}}</td>
                            <td class="text-right">
                                <a class="btn btn-outline-primary"
                                   href="{{route('dashboard.posts.details', $post->id)}}">Edit</a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
@endsection

Zerion Mini Shell 1.0