/** * @param $instance * @param bool $active * @return string */ protected function editButton($instance, $active = true) { if ($active == false) { return ''; } return view('admin::_partials.button')->with('type', self::EDIT_BUTTON)->with('link', $this->router->routeToEdit($this->modelItem->getAlias(), $instance->getKey()))->with('data-toggle', 'tooltip')->with('title', Lang::get('admin::lang.table.edit')); }
/** * @param $instance * @param bool $active * @return string */ protected function editButton($instance, $active = true) { $editParameters = ['class' => 'btn btn-default btn-sm', 'href' => $this->router->routeToEdit($this->modelItem->getAlias(), $instance->getKey()), 'data-toggle' => 'tooltip', 'title' => Lang::get('admin::lang.table.edit')]; if (!$active) { $editParameters[] = 'disabled'; } return $this->htmlBuilder->tag('a', $editParameters, '<i class="fa fa-pencil"></i>'); }
/** @test */ public function it_accepts_second_argument_as_not_array_in_routeTo_method() { $this->urlGenerator->shouldReceive('route')->with('test-prefix.table.edit', ['TestModel', 1])->once()->andReturn('some-route'); $route = $this->instance->routeToEdit('TestModel', 1); $this->assertEquals('some-route', $route); }