Donations Appreciated

You have not lived today until you have done something for someone who can never repay you. - John Bunyan

Click here to lend your support to: Laravel Datatables and make a donation at !

RelationController.php - Model Belongs To Demo

Id Title Author Email


    public function getBelongsTo(Request $request)
        if ($request->ajax()) {
            $query = Post::with('user')->select('posts.*');

            return $this->dataTable->eloquent($query)->make(true);

        return view('datatables.relation.belongs-to', [
            'title'      => 'Model Belongs To Demo',
            'controller' => 'Relation Controller',


        processing: true,
        serverSide: true,
        ajax: '',
        columns: [
            {data: 'id', name: ''},
            {data: 'title', name: 'posts.title'},
            {data: '', name: ''},
            {data: '', name: ''}