for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Encore\Admin\Grid\Actions;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;
class Delete extends RowAction
{
/**
* @return array|null|string
*/
public function name()
return __('admin.delete');
__('admin.delete');
string|array|null
array
Encore\Admin\Actions\Action::name
string
}
* @param Model $model
*
* @return Response
public function handle(Model $model)
$trans = [
'failed' => trans('admin.delete_failed'),
'succeeded' => trans('admin.delete_succeeded'),
];
try {
$model->delete();
} catch (\Exception $exception) {
return $this->getResponse()->error("{$trans['failed']} : {$exception->getMessage()}");
getResponse()
Encore\Admin\Grid\Actions\Delete
response()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
return $this->getResponse()->success($trans['succeeded'])->refresh();
* @return void
public function dialog()
$this->question(trans('admin.delete_confirm'), ['confirmButtonColor' => '#d33']);