ManageRentTablesContrller.php 835 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/13
 * Time: 17:41
 */

namespace App\Http\Controllers\Backend\ManageRent;

use App\Repositories\Backend\ManageRent\ManageRentRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Yajra\DataTables\Facades\DataTables;

class ManageRentTablesContrller       extends Controller
{
    private $managerent;


    public function __construct(ManageRentRepository $managerent)
    {
        $this->managerent = $managerent;
    }

    public function __invoke(Request $request)
    {
        return DataTables::of($this->managerent->getinfo())
            ->addColumn('actions', function ($managerent) {
                return $managerent->action_buttons;
            })
            ->rawColumns(['actions'])
            ->make(true);
    }
}