OtaTableController.php
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace App\Http\Controllers\Backend\OTA;
use App\Http\Requests\Backend\Ota\Backend\ManageOtaVersionRequest;
use App\Repositories\Backend\Ota\OtaVersionRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Yajra\DataTables\Facades\DataTables;
class OtaTableController extends Controller
{
/**
* @var OtaVersionRepository
*/
protected $otaVersions;
/**
* OtaController constructor.
* @param OtaVersionRepository $otaVersions
*/
public function __construct(OtaVersionRepository $otaVersions)
{
$this->otaVersions = $otaVersions;
}
/**
* @param ManageOtaVersionRequest $request
* @return mixed
*/
public function __invoke(ManageOtaVersionRequest $request)
{
return DataTables::of($this->otaVersions->getForDataTable())
->addColumn('actions', function ($version) {
return $version->action_buttons;
})
->rawColumns(['actions'])
->make(true);
}
}