ManageSpotTablesController.php 793 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/14
 * Time: 14:48
 */

namespace App\Http\Controllers\Backend\ManageSpot;


use App\Repositories\Backend\ManageSpot\ManageSpotRepository;

class ManageSpotTablesController
{
    private $managespot;

    /**
     * BusinessController constructor.
     * @param $businessRepository
     */
    public function __construct(ManageSpotRepository $managespot)
    {
        $this->managespot = $managespot;
    }

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