コード例 #1
0
    /**
     * Datatables data
     *
     * @return Datatables JSON
     */
    public function data()
    {
        //		$query = Profile::select(array('profiles.id','profiles.first_name','profiles.last_name','profiles.email_1','profiles.email_2'))
        //			->orderBy('profiles.last_name', 'ASC');
        //		$query = Profile::select('id', 'first_name', 'last_name', 'email_1', 'email_2')
        //			->orderBy('last_name', 'ASC');
        $query = Profile::select('id', 'first_name', 'last_name', 'email_1', 'email_2')->orderBy('profiles.last_name', 'ASC');
        //dd($query);
        return Datatables::of($query)->addColumn('actions', '
					<a href="{{ URL::to(\'profiles/\' . $id . \'/\' ) }}" class="btn btn-info btn-sm" >
						<span class="glyphicon glyphicon-search"></span>  {{ trans("kotoba::button.view") }}
					</a>
					<a href="{{ URL::to(\'profiles/\' . $id . \'/edit\' ) }}" class="btn btn-success btn-sm" >
						<span class="glyphicon glyphicon-pencil"></span>  {{ trans("kotoba::button.edit") }}
					</a>
				')->make(true);
    }