/** * gets deleted sections * * @param $filter * @return \Illuminate\Database\Eloquent\Collection|static[] */ public function deleted($filter) { $filter = array_only($filter, ['deleted_at']); $query = $this->section->onlyTrashed()->where(function ($q) use($filter) { foreach ($filter as $key => $value) { $q->where($key, '>', $value); } }); return $query->get(['id', 'deleted_at']); }
@extends('layouts.master') @section('content') <?php $section = \App\Nrna\Models\Section::find($section_id); $categories = \App\Nrna\Models\CategoryAttribute::where('parent_id', 0)->where('section_id', $section_id)->lists('title', 'id'); ?> <h1>Section : {{$section->title}}</h1> <h3>Categories <a href="{{ route('section.category.create',$section_id) }}" class="btn btn-primary pull-right btn-sm">Add New Category</a></h3> {!! Form::open(['route' => ['section.category.index',$section_id], 'method' => 'get', 'class'=>'form-inline']) !!} {!! Form::select('category',$categories,Input::get('category'), ['class' =>'form-control','placeholder'=>'']) !!} {!! Form::submit('filter', ['class' => 'btn btn-primary']) !!} {!! Form::close() !!} <div class="table"> <table class="table table-bordered table-striped table-hover"> <thead> <tr> <th>S.No</th> <th>Title</th> <th>Category</th> <th>Actions</th> </tr> </thead> <tbody class="sortable" data-entityname="section_category"> {{-- */$x=0;/* --}} @forelse($categoryattributes as $item) {{-- */$x++;/* --}} <tr data-itemId="{{{ $item->id }}}"> <td class="sortable-handle"><span class="glyphicon glyphicon-sort"></span></td>