templates/controller/controllerTemplate.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $data['title'] = ucfirst('_MODEL');
        $data['active'] = (object) [
            'link' => strtolower('_MODEL'),
            'parent' => strtolower('_MODEL')
        ];
        $data['breadcrumb'] = [
            [
                'page' => ucfirst('_MODEL'),
                'url' => '',
                'active' => true
            ]
        ];
        if ($query = request()->query('q')) {
        } else {
            $items = _MODEL::orderBy('id', 'desc');
        }
        $paginated = $items->paginate(15);
        $data['items'] = $paginated;
        return view('admin.' . strtolower('_MODEL') . '.index', $data);
    }
public function index ( ) { $ data [ 'title' ] = ucfirst ( '_MODEL' ) ; $ data [ 'active' ] = ( object ) [ 'link' => strtolower ( '_MODEL' ) , 'parent' => strtolower ( '_MODEL' ) ] ; $ data [ 'breadcrumb' ] = [ [ 'page' => ucfirst ( '_MODEL' ) , 'url' => '' , 'active' => true ] ] ; if ( $ query = request ( ) -> query ( 'q' ) ) { } else { $ items = _MODEL :: orderBy ( 'id' , 'desc' ) ; } $ paginated = $ items -> paginate ( 15 ) ; $ data [ 'items' ] = $ paginated ; return view ( 'admin.' . strtolower ( '_MODEL' ) . '.index' , $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .
// TODO: UNCOMMENT AND FIX WHERE CLAUSE // $items = _MODEL::where('', 'like', '%' . $query . '%') //     ->orWhere('', 'like', '%' . $query . '%') //     ->distinct() //     ->orderBy('id', 'desc');