⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.77
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
ecommerce_pg
/
app
/
Http
/
Controllers
/
Admin
/
View File Name :
TransactionLogCrudController.php
<?php namespace App\Http\Controllers\Admin; use App\Http\Requests\TransactionLogRequest; use Backpack\CRUD\app\Http\Controllers\CrudController; use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD; /** * Class TransactionLogCrudController * @package App\Http\Controllers\Admin * @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud */ class TransactionLogCrudController extends CrudController { use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation; /** * Configure the CrudPanel object. Apply settings to all operations. * * @return void */ public function setup() { CRUD::setModel(\App\Models\TransactionLog::class); CRUD::setRoute(config('backpack.base.route_prefix') . '/transactionlog'); CRUD::setEntityNameStrings('transactionlog', 'transaction_logs'); CRUD::removeAllButtons(); } /** * Define what happens when the List operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-list-entries * @return void */ protected function setupListOperation() { CRUD::setFromDb(); // columns CRUD::removeColumns(['user_agent','location']); // fields CRUD::denyAccess(['create','show','update','delete','preview']); CRUD::removeAllButtons(); $this->crud->addFilter([ 'type' => 'text', 'name' => 'countryName', 'label' => 'Country Name' ], false, function ($value) { $this->crud->addClause('where', 'countryName', $value); }); $this->crud->addFilter([ 'type' => 'text', 'name' => 'countryCode', 'label' => 'Country Code' ], false, function ($value) { $this->crud->addClause('where', 'countryCode', $value); }); $this->crud->addFilter([ 'type' => 'text', 'name' => 'regionCode', 'label' => 'Region Code' ], false, function ($value) { $this->crud->addClause('where', 'regionCode', $value); }); $this->crud->addFilter([ 'type' => 'text', 'name' => 'regionName', 'label' => 'Region Name' ], false, function ($value) { $this->crud->addClause('where', 'regionName', $value); }); $this->crud->addFilter([ 'type' => 'text', 'name' => 'cityName', 'label' => 'City Name' ], false, function ($value) { $this->crud->addClause('where', 'cityName', $value); }); } /** * Define what happens when the Create operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-create * @return void */ protected function setupCreateOperation() { CRUD::setValidation(TransactionLogRequest::class); CRUD::setFromDb(); // fields /** * Fields can be defined using the fluent syntax or array syntax: * - CRUD::field('price')->type('number'); * - CRUD::addField(['name' => 'price', 'type' => 'number'])); */ } /** * Define what happens when the Update operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-update * @return void */ protected function setupUpdateOperation() { $this->setupCreateOperation(); } }