id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
207,400
z-song/laravel-admin
src/Show.php
Show.addRelation
protected function addRelation($name, $builder, $label = '') { $relation = new Relation($name, $builder, $label); $relation->setParent($this); $this->overwriteExistingRelation($name); return tap($relation, function ($relation) { $this->relations->push($relation); ...
php
protected function addRelation($name, $builder, $label = '') { $relation = new Relation($name, $builder, $label); $relation->setParent($this); $this->overwriteExistingRelation($name); return tap($relation, function ($relation) { $this->relations->push($relation); ...
[ "protected", "function", "addRelation", "(", "$", "name", ",", "$", "builder", ",", "$", "label", "=", "''", ")", "{", "$", "relation", "=", "new", "Relation", "(", "$", "name", ",", "$", "builder", ",", "$", "label", ")", ";", "$", "relation", "->...
Add a relation panel to show. @param string $name @param \Closure $builder @param string $label @return Relation
[ "Add", "a", "relation", "panel", "to", "show", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L240-L251
207,401
z-song/laravel-admin
src/Show.php
Show.overwriteExistingField
protected function overwriteExistingField($name) { if ($this->fields->isEmpty()) { return; } $this->fields = $this->fields->filter( function (Field $field) use ($name) { return $field->getName() != $name; } ); }
php
protected function overwriteExistingField($name) { if ($this->fields->isEmpty()) { return; } $this->fields = $this->fields->filter( function (Field $field) use ($name) { return $field->getName() != $name; } ); }
[ "protected", "function", "overwriteExistingField", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "fields", "->", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "$", "this", "->", "fields", "=", "$", "this", "->", "fields", "->", "filt...
Overwrite existing field. @param string $name
[ "Overwrite", "existing", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L258-L269
207,402
z-song/laravel-admin
src/Show.php
Show.overwriteExistingRelation
protected function overwriteExistingRelation($name) { if ($this->relations->isEmpty()) { return; } $this->relations = $this->relations->filter( function (Relation $relation) use ($name) { return $relation->getName() != $name; } ); ...
php
protected function overwriteExistingRelation($name) { if ($this->relations->isEmpty()) { return; } $this->relations = $this->relations->filter( function (Relation $relation) use ($name) { return $relation->getName() != $name; } ); ...
[ "protected", "function", "overwriteExistingRelation", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "relations", "->", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "$", "this", "->", "relations", "=", "$", "this", "->", "relations", "...
Overwrite existing relation. @param string $name
[ "Overwrite", "existing", "relation", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L276-L287
207,403
z-song/laravel-admin
src/Show.php
Show.handleGetMutatorField
protected function handleGetMutatorField($method, $label) { if (is_null($this->model)) { return false; } if ($this->model->hasGetMutator($method)) { return $this->addField($method, $label); } return false; }
php
protected function handleGetMutatorField($method, $label) { if (is_null($this->model)) { return false; } if ($this->model->hasGetMutator($method)) { return $this->addField($method, $label); } return false; }
[ "protected", "function", "handleGetMutatorField", "(", "$", "method", ",", "$", "label", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "model", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "model", "->", "hasGet...
Handle the get mutator field. @param string $method @param string $label @return bool|Field
[ "Handle", "the", "get", "mutator", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L406-L417
207,404
z-song/laravel-admin
src/Show.php
Show.handleRelationField
protected function handleRelationField($method, $arguments) { if (!method_exists($this->model, $method)) { return false; } if (!($relation = $this->model->$method()) instanceof EloquentRelation) { return false; } if ($relation instanceof HasOne ...
php
protected function handleRelationField($method, $arguments) { if (!method_exists($this->model, $method)) { return false; } if (!($relation = $this->model->$method()) instanceof EloquentRelation) { return false; } if ($relation instanceof HasOne ...
[ "protected", "function", "handleRelationField", "(", "$", "method", ",", "$", "arguments", ")", "{", "if", "(", "!", "method_exists", "(", "$", "this", "->", "model", ",", "$", "method", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "("...
Handle relation field. @param string $method @param array $arguments @return $this|bool|Relation|Field
[ "Handle", "relation", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L427-L475
207,405
z-song/laravel-admin
src/Show.php
Show.handleModelField
protected function handleModelField($method, $label) { if (in_array($method, $this->model->getAttributes())) { return $this->addField($method, $label); } return false; }
php
protected function handleModelField($method, $label) { if (in_array($method, $this->model->getAttributes())) { return $this->addField($method, $label); } return false; }
[ "protected", "function", "handleModelField", "(", "$", "method", ",", "$", "label", ")", "{", "if", "(", "in_array", "(", "$", "method", ",", "$", "this", "->", "model", "->", "getAttributes", "(", ")", ")", ")", "{", "return", "$", "this", "->", "ad...
Handle model field. @param string $method @param string $label @return bool|Field
[ "Handle", "model", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L490-L497
207,406
z-song/laravel-admin
src/Show.php
Show.render
public function render() { if (is_callable($this->builder)) { call_user_func($this->builder, $this); } if ($this->fields->isEmpty()) { $this->all(); } if (is_array($this->builder)) { $this->fields($this->builder); } $this...
php
public function render() { if (is_callable($this->builder)) { call_user_func($this->builder, $this); } if ($this->fields->isEmpty()) { $this->all(); } if (is_array($this->builder)) { $this->fields($this->builder); } $this...
[ "public", "function", "render", "(", ")", "{", "if", "(", "is_callable", "(", "$", "this", "->", "builder", ")", ")", "{", "call_user_func", "(", "$", "this", "->", "builder", ",", "$", "this", ")", ";", "}", "if", "(", "$", "this", "->", "fields",...
Render the show panels. @return string
[ "Render", "the", "show", "panels", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L504-L527
207,407
z-song/laravel-admin
src/Grid/Filter/Between.php
Between.formatName
protected function formatName($column) { $columns = explode('.', $column); if (count($columns) == 1) { $name = $columns[0]; } else { $name = array_shift($columns); foreach ($columns as $column) { $name .= "[$column]"; } ...
php
protected function formatName($column) { $columns = explode('.', $column); if (count($columns) == 1) { $name = $columns[0]; } else { $name = array_shift($columns); foreach ($columns as $column) { $name .= "[$column]"; } ...
[ "protected", "function", "formatName", "(", "$", "column", ")", "{", "$", "columns", "=", "explode", "(", "'.'", ",", "$", "column", ")", ";", "if", "(", "count", "(", "$", "columns", ")", "==", "1", ")", "{", "$", "name", "=", "$", "columns", "[...
Format two field names of this filter. @param string $column @return array
[ "Format", "two", "field", "names", "of", "this", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Between.php#L36-L51
207,408
z-song/laravel-admin
src/Grid/Tools/Header.php
Header.queryBuilder
public function queryBuilder() { if (!$this->queryBuilder) { $this->queryBuilder = $this->grid->model()->getQueryBuilder(); } return $this->queryBuilder; }
php
public function queryBuilder() { if (!$this->queryBuilder) { $this->queryBuilder = $this->grid->model()->getQueryBuilder(); } return $this->queryBuilder; }
[ "public", "function", "queryBuilder", "(", ")", "{", "if", "(", "!", "$", "this", "->", "queryBuilder", ")", "{", "$", "this", "->", "queryBuilder", "=", "$", "this", "->", "grid", "->", "model", "(", ")", "->", "getQueryBuilder", "(", ")", ";", "}",...
Get model query builder. @return \Illuminate\Database\Eloquent\Builder
[ "Get", "model", "query", "builder", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools/Header.php#L32-L39
207,409
z-song/laravel-admin
src/Grid/Filter/Layout/Layout.php
Layout.column
public function column($width, \Closure $closure) { if ($this->columns->isEmpty()) { $column = $this->current; $column->setWidth($width); } else { $column = new Column($width); $this->current = $column; } $this->columns->push($column...
php
public function column($width, \Closure $closure) { if ($this->columns->isEmpty()) { $column = $this->current; $column->setWidth($width); } else { $column = new Column($width); $this->current = $column; } $this->columns->push($column...
[ "public", "function", "column", "(", "$", "width", ",", "\\", "Closure", "$", "closure", ")", "{", "if", "(", "$", "this", "->", "columns", "->", "isEmpty", "(", ")", ")", "{", "$", "column", "=", "$", "this", "->", "current", ";", "$", "column", ...
Add a new column in layout. @param int $width @param \Closure $closure
[ "Add", "a", "new", "column", "in", "layout", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Layout/Layout.php#L55-L70
207,410
z-song/laravel-admin
src/Grid/Filter/Layout/Layout.php
Layout.columns
public function columns() { if ($this->columns->isEmpty()) { $this->columns->push($this->current); } return $this->columns; }
php
public function columns() { if ($this->columns->isEmpty()) { $this->columns->push($this->current); } return $this->columns; }
[ "public", "function", "columns", "(", ")", "{", "if", "(", "$", "this", "->", "columns", "->", "isEmpty", "(", ")", ")", "{", "$", "this", "->", "columns", "->", "push", "(", "$", "this", "->", "current", ")", ";", "}", "return", "$", "this", "->...
Get all columns in filter layout. @return Collection
[ "Get", "all", "columns", "in", "filter", "layout", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Layout/Layout.php#L77-L84
207,411
z-song/laravel-admin
src/Grid/Filter/Layout/Column.php
Column.removeFilterByID
public function removeFilterByID($id) { $this->filters = $this->filters->reject(function (AbstractFilter $filter) use ($id) { return $filter->getId() == $id; }); }
php
public function removeFilterByID($id) { $this->filters = $this->filters->reject(function (AbstractFilter $filter) use ($id) { return $filter->getId() == $id; }); }
[ "public", "function", "removeFilterByID", "(", "$", "id", ")", "{", "$", "this", "->", "filters", "=", "$", "this", "->", "filters", "->", "reject", "(", "function", "(", "AbstractFilter", "$", "filter", ")", "use", "(", "$", "id", ")", "{", "return", ...
Remove filter from column by id.
[ "Remove", "filter", "from", "column", "by", "id", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Layout/Column.php#L74-L79
207,412
z-song/laravel-admin
src/Widgets/Box.php
Box.content
public function content($content) { if ($content instanceof Renderable) { $this->content = $content->render(); } else { $this->content = (string) $content; } return $this; }
php
public function content($content) { if ($content instanceof Renderable) { $this->content = $content->render(); } else { $this->content = (string) $content; } return $this; }
[ "public", "function", "content", "(", "$", "content", ")", "{", "if", "(", "$", "content", "instanceof", "Renderable", ")", "{", "$", "this", "->", "content", "=", "$", "content", "->", "render", "(", ")", ";", "}", "else", "{", "$", "this", "->", ...
Set box content. @param string $content @return $this
[ "Set", "box", "content", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Box.php#L55-L64
207,413
z-song/laravel-admin
src/Widgets/Box.php
Box.style
public function style($styles) { if (is_string($styles)) { return $this->style([$styles]); } $styles = array_map(function ($style) { return 'box-'.$style; }, $styles); $this->class = $this->class.' '.implode(' ', $styles); return $this; ...
php
public function style($styles) { if (is_string($styles)) { return $this->style([$styles]); } $styles = array_map(function ($style) { return 'box-'.$style; }, $styles); $this->class = $this->class.' '.implode(' ', $styles); return $this; ...
[ "public", "function", "style", "(", "$", "styles", ")", "{", "if", "(", "is_string", "(", "$", "styles", ")", ")", "{", "return", "$", "this", "->", "style", "(", "[", "$", "styles", "]", ")", ";", "}", "$", "styles", "=", "array_map", "(", "func...
Set box style. @param string $styles @return $this|Box
[ "Set", "box", "style", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Box.php#L113-L126
207,414
z-song/laravel-admin
src/Form/Field/Tags.php
Tags.pluck
public function pluck($visibleColumn, $key) { if (!empty($visibleColumn) && !empty($key)) { $this->keyAsValue = true; } $this->visibleColumn = $visibleColumn; $this->key = $key; return $this; }
php
public function pluck($visibleColumn, $key) { if (!empty($visibleColumn) && !empty($key)) { $this->keyAsValue = true; } $this->visibleColumn = $visibleColumn; $this->key = $key; return $this; }
[ "public", "function", "pluck", "(", "$", "visibleColumn", ",", "$", "key", ")", "{", "if", "(", "!", "empty", "(", "$", "visibleColumn", ")", "&&", "!", "empty", "(", "$", "key", ")", ")", "{", "$", "this", "->", "keyAsValue", "=", "true", ";", "...
Set visible column and key of data. @param $visibleColumn @param $key @return $this
[ "Set", "visible", "column", "and", "key", "of", "data", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Tags.php#L77-L87
207,415
z-song/laravel-admin
src/Auth/Database/Permission.php
Permission.matchRequest
protected function matchRequest(array $match, Request $request) : bool { if (!$request->is(trim($match['path'], '/'))) { return false; } $method = collect($match['method'])->filter()->map(function ($method) { return strtoupper($method); }); return $m...
php
protected function matchRequest(array $match, Request $request) : bool { if (!$request->is(trim($match['path'], '/'))) { return false; } $method = collect($match['method'])->filter()->map(function ($method) { return strtoupper($method); }); return $m...
[ "protected", "function", "matchRequest", "(", "array", "$", "match", ",", "Request", "$", "request", ")", ":", "bool", "{", "if", "(", "!", "$", "request", "->", "is", "(", "trim", "(", "$", "match", "[", "'path'", "]", ",", "'/'", ")", ")", ")", ...
If a request match the specific HTTP method and path. @param array $match @param Request $request @return bool
[ "If", "a", "request", "match", "the", "specific", "HTTP", "method", "and", "path", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Auth/Database/Permission.php#L109-L120
207,416
z-song/laravel-admin
src/Middleware/Pjax.php
Pjax.respond
public static function respond(Response $response) { $next = function () use ($response) { return $response; }; (new static())->handle(Request::capture(), $next)->send(); exit; }
php
public static function respond(Response $response) { $next = function () use ($response) { return $response; }; (new static())->handle(Request::capture(), $next)->send(); exit; }
[ "public", "static", "function", "respond", "(", "Response", "$", "response", ")", "{", "$", "next", "=", "function", "(", ")", "use", "(", "$", "response", ")", "{", "return", "$", "response", ";", "}", ";", "(", "new", "static", "(", ")", ")", "->...
Send a response through this middleware. @param Response $response
[ "Send", "a", "response", "through", "this", "middleware", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/Pjax.php#L48-L57
207,417
z-song/laravel-admin
src/Middleware/Pjax.php
Pjax.handleErrorResponse
protected function handleErrorResponse(Response $response) { $exception = $response->exception; $error = new MessageBag([ 'type' => get_class($exception), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), 'line' => $exce...
php
protected function handleErrorResponse(Response $response) { $exception = $response->exception; $error = new MessageBag([ 'type' => get_class($exception), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), 'line' => $exce...
[ "protected", "function", "handleErrorResponse", "(", "Response", "$", "response", ")", "{", "$", "exception", "=", "$", "response", "->", "exception", ";", "$", "error", "=", "new", "MessageBag", "(", "[", "'type'", "=>", "get_class", "(", "$", "exception", ...
Handle Response with exceptions. @param Response $response @return \Illuminate\Http\RedirectResponse
[ "Handle", "Response", "with", "exceptions", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/Pjax.php#L66-L78
207,418
z-song/laravel-admin
src/Middleware/Pjax.php
Pjax.fetchContents
protected function fetchContents($crawler, $container) { $content = $crawler->filter($container); if (!$content->count()) { abort(422); } return $this->decodeUtf8HtmlEntities($content->html()); }
php
protected function fetchContents($crawler, $container) { $content = $crawler->filter($container); if (!$content->count()) { abort(422); } return $this->decodeUtf8HtmlEntities($content->html()); }
[ "protected", "function", "fetchContents", "(", "$", "crawler", ",", "$", "container", ")", "{", "$", "content", "=", "$", "crawler", "->", "filter", "(", "$", "container", ")", ";", "if", "(", "!", "$", "content", "->", "count", "(", ")", ")", "{", ...
Fetch the PJAX-specific HTML from the response. @param Crawler $crawler @param string $container @return string
[ "Fetch", "the", "PJAX", "-", "specific", "HTML", "from", "the", "response", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/Pjax.php#L122-L131
207,419
z-song/laravel-admin
src/Grid/Filter/Presenter/Text.php
Text.variables
public function variables() : array { return [ 'placeholder' => $this->placeholder, 'icon' => $this->icon, 'type' => $this->type, 'group' => $this->filter->group, ]; }
php
public function variables() : array { return [ 'placeholder' => $this->placeholder, 'icon' => $this->icon, 'type' => $this->type, 'group' => $this->filter->group, ]; }
[ "public", "function", "variables", "(", ")", ":", "array", "{", "return", "[", "'placeholder'", "=>", "$", "this", "->", "placeholder", ",", "'icon'", "=>", "$", "this", "->", "icon", ",", "'type'", "=>", "$", "this", "->", "type", ",", "'group'", "=>"...
Get variables for field template. @return array
[ "Get", "variables", "for", "field", "template", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Presenter/Text.php#L39-L47
207,420
z-song/laravel-admin
src/Form/NestedForm.php
NestedForm.prepareRecord
protected function prepareRecord($record) { if ($record[static::REMOVE_FLAG_NAME] == 1) { return $record; } $prepared = []; /* @var Field $field */ foreach ($this->fields as $field) { $columns = $field->column(); $value = $this->fetchCol...
php
protected function prepareRecord($record) { if ($record[static::REMOVE_FLAG_NAME] == 1) { return $record; } $prepared = []; /* @var Field $field */ foreach ($this->fields as $field) { $columns = $field->column(); $value = $this->fetchCol...
[ "protected", "function", "prepareRecord", "(", "$", "record", ")", "{", "if", "(", "$", "record", "[", "static", "::", "REMOVE_FLAG_NAME", "]", "==", "1", ")", "{", "return", "$", "record", ";", "}", "$", "prepared", "=", "[", "]", ";", "/* @var Field ...
Do prepare work before store and update. @param array $record @return array
[ "Do", "prepare", "work", "before", "store", "and", "update", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/NestedForm.php#L256-L292
207,421
z-song/laravel-admin
src/Form/NestedForm.php
NestedForm.fetchColumnValue
protected function fetchColumnValue($data, $columns) { if (is_string($columns)) { return Arr::get($data, $columns); } if (is_array($columns)) { $value = []; foreach ($columns as $name => $column) { if (!Arr::has($data, $column)) { ...
php
protected function fetchColumnValue($data, $columns) { if (is_string($columns)) { return Arr::get($data, $columns); } if (is_array($columns)) { $value = []; foreach ($columns as $name => $column) { if (!Arr::has($data, $column)) { ...
[ "protected", "function", "fetchColumnValue", "(", "$", "data", ",", "$", "columns", ")", "{", "if", "(", "is_string", "(", "$", "columns", ")", ")", "{", "return", "Arr", "::", "get", "(", "$", "data", ",", "$", "columns", ")", ";", "}", "if", "(",...
Fetch value in input data by column name. @param array $data @param string|array $columns @return array|mixed
[ "Fetch", "value", "in", "input", "data", "by", "column", "name", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/NestedForm.php#L302-L319
207,422
z-song/laravel-admin
src/Form/Field/Embeds.php
Embeds.getEmbeddedData
protected function getEmbeddedData() { if ($old = old($this->column)) { return $old; } if (empty($this->value)) { return []; } if (is_string($this->value)) { return json_decode($this->value, true); } return (array) $this-...
php
protected function getEmbeddedData() { if ($old = old($this->column)) { return $old; } if (empty($this->value)) { return []; } if (is_string($this->value)) { return json_decode($this->value, true); } return (array) $this-...
[ "protected", "function", "getEmbeddedData", "(", ")", "{", "if", "(", "$", "old", "=", "old", "(", "$", "this", "->", "column", ")", ")", "{", "return", "$", "old", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "value", ")", ")", "{", "...
Get data for Embedded form. Normally, data is obtained from the database. When the data validation errors, data is obtained from session flash. @return array
[ "Get", "data", "for", "Embedded", "form", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Embeds.php#L210-L225
207,423
z-song/laravel-admin
src/Form/Field/Embeds.php
Embeds.buildEmbeddedForm
protected function buildEmbeddedForm() { $form = new EmbeddedForm($this->column); $form->setParent($this->form); call_user_func($this->builder, $form); $form->fill($this->getEmbeddedData()); return $form; }
php
protected function buildEmbeddedForm() { $form = new EmbeddedForm($this->column); $form->setParent($this->form); call_user_func($this->builder, $form); $form->fill($this->getEmbeddedData()); return $form; }
[ "protected", "function", "buildEmbeddedForm", "(", ")", "{", "$", "form", "=", "new", "EmbeddedForm", "(", "$", "this", "->", "column", ")", ";", "$", "form", "->", "setParent", "(", "$", "this", "->", "form", ")", ";", "call_user_func", "(", "$", "thi...
Build a Embedded Form and fill data. @return EmbeddedForm
[ "Build", "a", "Embedded", "Form", "and", "fill", "data", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Embeds.php#L232-L243
207,424
z-song/laravel-admin
src/Form/Field/Html.php
Html.render
public function render() { if ($this->html instanceof \Closure) { $this->html = $this->html->call($this->form->model(), $this->form); } if ($this->plain) { return $this->html; } $viewClass = $this->getViewElementClasses(); return <<<EOT <div...
php
public function render() { if ($this->html instanceof \Closure) { $this->html = $this->html->call($this->form->model(), $this->form); } if ($this->plain) { return $this->html; } $viewClass = $this->getViewElementClasses(); return <<<EOT <div...
[ "public", "function", "render", "(", ")", "{", "if", "(", "$", "this", "->", "html", "instanceof", "\\", "Closure", ")", "{", "$", "this", "->", "html", "=", "$", "this", "->", "html", "->", "call", "(", "$", "this", "->", "form", "->", "model", ...
Render html field. @return string
[ "Render", "html", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Html.php#L55-L75
207,425
z-song/laravel-admin
src/Grid/Concerns/HasFilter.php
HasFilter.disableFilter
public function disableFilter(bool $disable = true) { $this->tools->disableFilterButton($disable); return $this->option('show_filter', !$disable); }
php
public function disableFilter(bool $disable = true) { $this->tools->disableFilterButton($disable); return $this->option('show_filter', !$disable); }
[ "public", "function", "disableFilter", "(", "bool", "$", "disable", "=", "true", ")", "{", "$", "this", "->", "tools", "->", "disableFilterButton", "(", "$", "disable", ")", ";", "return", "$", "this", "->", "option", "(", "'show_filter'", ",", "!", "$",...
Disable grid filter. @return $this
[ "Disable", "grid", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Concerns/HasFilter.php#L33-L38
207,426
z-song/laravel-admin
src/Grid/Concerns/HasFilter.php
HasFilter.processFilter
public function processFilter($toArray = true) { if ($this->builder) { call_user_func($this->builder, $this); } return $this->filter->execute($toArray); }
php
public function processFilter($toArray = true) { if ($this->builder) { call_user_func($this->builder, $this); } return $this->filter->execute($toArray); }
[ "public", "function", "processFilter", "(", "$", "toArray", "=", "true", ")", "{", "if", "(", "$", "this", "->", "builder", ")", "{", "call_user_func", "(", "$", "this", "->", "builder", ",", "$", "this", ")", ";", "}", "return", "$", "this", "->", ...
Process the grid filter. @param bool $toArray @return array|Collection|mixed
[ "Process", "the", "grid", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Concerns/HasFilter.php#L57-L64
207,427
z-song/laravel-admin
src/Show/Field.php
Field.using
public function using(array $values, $default = null) { return $this->as(function ($value) use ($values, $default) { if (is_null($value)) { return $default; } return Arr::get($values, $value, $default); }); }
php
public function using(array $values, $default = null) { return $this->as(function ($value) use ($values, $default) { if (is_null($value)) { return $default; } return Arr::get($values, $value, $default); }); }
[ "public", "function", "using", "(", "array", "$", "values", ",", "$", "default", "=", "null", ")", "{", "return", "$", "this", "->", "as", "(", "function", "(", "$", "value", ")", "use", "(", "$", "values", ",", "$", "default", ")", "{", "if", "(...
Display field using array value map. @param array $values @param null $default @return $this
[ "Display", "field", "using", "array", "value", "map", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L191-L200
207,428
z-song/laravel-admin
src/Show/Field.php
Field.image
public function image($server = '', $width = 200, $height = 200) { return $this->unescape()->as(function ($images) use ($server, $width, $height) { return collect($images)->map(function ($path) use ($server, $width, $height) { if (empty($path)) { return ''; ...
php
public function image($server = '', $width = 200, $height = 200) { return $this->unescape()->as(function ($images) use ($server, $width, $height) { return collect($images)->map(function ($path) use ($server, $width, $height) { if (empty($path)) { return ''; ...
[ "public", "function", "image", "(", "$", "server", "=", "''", ",", "$", "width", "=", "200", ",", "$", "height", "=", "200", ")", "{", "return", "$", "this", "->", "unescape", "(", ")", "->", "as", "(", "function", "(", "$", "images", ")", "use",...
Show field as a image. @param string $server @param int $width @param int $height @return $this
[ "Show", "field", "as", "a", "image", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L211-L236
207,429
z-song/laravel-admin
src/Show/Field.php
Field.file
public function file($server = '', $download = true) { $field = $this; return $this->unescape()->as(function ($path) use ($server, $download, $field) { $name = basename($path); $field->border = false; $size = $url = ''; if (url()->isValidUrl($path)...
php
public function file($server = '', $download = true) { $field = $this; return $this->unescape()->as(function ($path) use ($server, $download, $field) { $name = basename($path); $field->border = false; $size = $url = ''; if (url()->isValidUrl($path)...
[ "public", "function", "file", "(", "$", "server", "=", "''", ",", "$", "download", "=", "true", ")", "{", "$", "field", "=", "$", "this", ";", "return", "$", "this", "->", "unescape", "(", ")", "->", "as", "(", "function", "(", "$", "path", ")", ...
Show field as a file. @param string $server @param bool $download @return Field
[ "Show", "field", "as", "a", "file", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L246-L290
207,430
z-song/laravel-admin
src/Show/Field.php
Field.link
public function link($href = '', $target = '_blank') { return $this->unescape()->as(function ($link) use ($href, $target) { $href = $href ?: $link; return "<a href='$href' target='{$target}'>{$link}</a>"; }); }
php
public function link($href = '', $target = '_blank') { return $this->unescape()->as(function ($link) use ($href, $target) { $href = $href ?: $link; return "<a href='$href' target='{$target}'>{$link}</a>"; }); }
[ "public", "function", "link", "(", "$", "href", "=", "''", ",", "$", "target", "=", "'_blank'", ")", "{", "return", "$", "this", "->", "unescape", "(", ")", "->", "as", "(", "function", "(", "$", "link", ")", "use", "(", "$", "href", ",", "$", ...
Show field as a link. @param string $href @param string $target @return Field
[ "Show", "field", "as", "a", "link", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L300-L307
207,431
z-song/laravel-admin
src/Show/Field.php
Field.label
public function label($style = 'success') { return $this->unescape()->as(function ($value) use ($style) { if ($value instanceof Arrayable) { $value = $value->toArray(); } return collect((array) $value)->map(function ($name) use ($style) { ...
php
public function label($style = 'success') { return $this->unescape()->as(function ($value) use ($style) { if ($value instanceof Arrayable) { $value = $value->toArray(); } return collect((array) $value)->map(function ($name) use ($style) { ...
[ "public", "function", "label", "(", "$", "style", "=", "'success'", ")", "{", "return", "$", "this", "->", "unescape", "(", ")", "->", "as", "(", "function", "(", "$", "value", ")", "use", "(", "$", "style", ")", "{", "if", "(", "$", "value", "in...
Show field as labels. @param string $style @return Field
[ "Show", "field", "as", "labels", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L316-L327
207,432
z-song/laravel-admin
src/Show/Field.php
Field.json
public function json() { $field = $this; return $this->unescape()->as(function ($value) use ($field) { $content = json_decode($value, true); if (json_last_error() == 0) { $field->border = false; return '<pre><code>'.json_encode($content, JSO...
php
public function json() { $field = $this; return $this->unescape()->as(function ($value) use ($field) { $content = json_decode($value, true); if (json_last_error() == 0) { $field->border = false; return '<pre><code>'.json_encode($content, JSO...
[ "public", "function", "json", "(", ")", "{", "$", "field", "=", "$", "this", ";", "return", "$", "this", "->", "unescape", "(", ")", "->", "as", "(", "function", "(", "$", "value", ")", "use", "(", "$", "field", ")", "{", "$", "content", "=", "...
Show field as json code. @return Field
[ "Show", "field", "as", "json", "code", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L354-L369
207,433
z-song/laravel-admin
src/Show/Field.php
Field.getFileIcon
public function getFileIcon($file = '') { $extension = File::extension($file); foreach ($this->fileTypes as $type => $regex) { if (preg_match("/^($regex)$/i", $extension) !== 0) { return "fa-file-{$type}-o"; } } return 'fa-file-o'; }
php
public function getFileIcon($file = '') { $extension = File::extension($file); foreach ($this->fileTypes as $type => $regex) { if (preg_match("/^($regex)$/i", $extension) !== 0) { return "fa-file-{$type}-o"; } } return 'fa-file-o'; }
[ "public", "function", "getFileIcon", "(", "$", "file", "=", "''", ")", "{", "$", "extension", "=", "File", "::", "extension", "(", "$", "file", ")", ";", "foreach", "(", "$", "this", "->", "fileTypes", "as", "$", "type", "=>", "$", "regex", ")", "{...
Get file icon. @param string $file @return string
[ "Get", "file", "icon", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L378-L389
207,434
z-song/laravel-admin
src/Show/Field.php
Field.setValue
public function setValue(Model $model) { if ($this->relation) { if (!$relationValue = $model->{$this->relation}) { return $this; } $this->value = $relationValue; } else { $this->value = $model->getAttribute($this->name); } ...
php
public function setValue(Model $model) { if ($this->relation) { if (!$relationValue = $model->{$this->relation}) { return $this; } $this->value = $relationValue; } else { $this->value = $model->getAttribute($this->name); } ...
[ "public", "function", "setValue", "(", "Model", "$", "model", ")", "{", "if", "(", "$", "this", "->", "relation", ")", "{", "if", "(", "!", "$", "relationValue", "=", "$", "model", "->", "{", "$", "this", "->", "relation", "}", ")", "{", "return", ...
Set value for this field. @param Model $model @return $this
[ "Set", "value", "for", "this", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L422-L435
207,435
z-song/laravel-admin
src/Show/Field.php
Field.callExtendedField
protected function callExtendedField($abstract, $arguments = []) { if ($abstract instanceof \Closure) { return $this->as($abstract); } if (is_string($abstract) && class_exists($abstract)) { /** @var AbstractField $extend */ $extend = new $abstract(); ...
php
protected function callExtendedField($abstract, $arguments = []) { if ($abstract instanceof \Closure) { return $this->as($abstract); } if (is_string($abstract) && class_exists($abstract)) { /** @var AbstractField $extend */ $extend = new $abstract(); ...
[ "protected", "function", "callExtendedField", "(", "$", "abstract", ",", "$", "arguments", "=", "[", "]", ")", "{", "if", "(", "$", "abstract", "instanceof", "\\", "Closure", ")", "{", "return", "$", "this", "->", "as", "(", "$", "abstract", ")", ";", ...
Call extended field. @param string|AbstractField|\Closure $abstract @param array $arguments @return Field
[ "Call", "extended", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L477-L514
207,436
z-song/laravel-admin
src/Show/Field.php
Field.variables
protected function variables() { return [ 'content' => $this->value, 'escape' => $this->escape, 'label' => $this->getLabel(), 'wrapped' => $this->border, 'width' => $this->width, ]; }
php
protected function variables() { return [ 'content' => $this->value, 'escape' => $this->escape, 'label' => $this->getLabel(), 'wrapped' => $this->border, 'width' => $this->width, ]; }
[ "protected", "function", "variables", "(", ")", "{", "return", "[", "'content'", "=>", "$", "this", "->", "value", ",", "'escape'", "=>", "$", "this", "->", "escape", ",", "'label'", "=>", "$", "this", "->", "getLabel", "(", ")", ",", "'wrapped'", "=>"...
Get all variables passed to field view. @return array
[ "Get", "all", "variables", "passed", "to", "field", "view", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L545-L554
207,437
z-song/laravel-admin
src/Widgets/Form.php
Form.method
public function method($method = 'POST') { if (strtolower($method) == 'put') { $this->hidden('_method')->default($method); return $this; } return $this->attribute('method', strtoupper($method)); }
php
public function method($method = 'POST') { if (strtolower($method) == 'put') { $this->hidden('_method')->default($method); return $this; } return $this->attribute('method', strtoupper($method)); }
[ "public", "function", "method", "(", "$", "method", "=", "'POST'", ")", "{", "if", "(", "strtolower", "(", "$", "method", ")", "==", "'put'", ")", "{", "$", "this", "->", "hidden", "(", "'_method'", ")", "->", "default", "(", "$", "method", ")", ";...
Method of the form. @param string $method @return $this
[ "Method", "of", "the", "form", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Form.php#L134-L143
207,438
z-song/laravel-admin
src/Widgets/Form.php
Form.attribute
public function attribute($attr, $value = '') { if (is_array($attr)) { foreach ($attr as $key => $value) { $this->attribute($key, $value); } } else { $this->attributes[$attr] = $value; } return $this; }
php
public function attribute($attr, $value = '') { if (is_array($attr)) { foreach ($attr as $key => $value) { $this->attribute($key, $value); } } else { $this->attributes[$attr] = $value; } return $this; }
[ "public", "function", "attribute", "(", "$", "attr", ",", "$", "value", "=", "''", ")", "{", "if", "(", "is_array", "(", "$", "attr", ")", ")", "{", "foreach", "(", "$", "attr", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "this", "->",...
Add form attributes. @param string|array $attr @param string $value @return $this
[ "Add", "form", "attributes", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Form.php#L153-L164
207,439
z-song/laravel-admin
src/Widgets/Form.php
Form.formatAttribute
public function formatAttribute($attributes = []) { $attributes = $attributes ?: $this->attributes; if ($this->hasFile()) { $attributes['enctype'] = 'multipart/form-data'; } $html = []; foreach ($attributes as $key => $val) { $html[] = "$key=\"$val\"...
php
public function formatAttribute($attributes = []) { $attributes = $attributes ?: $this->attributes; if ($this->hasFile()) { $attributes['enctype'] = 'multipart/form-data'; } $html = []; foreach ($attributes as $key => $val) { $html[] = "$key=\"$val\"...
[ "public", "function", "formatAttribute", "(", "$", "attributes", "=", "[", "]", ")", "{", "$", "attributes", "=", "$", "attributes", "?", ":", "$", "this", "->", "attributes", ";", "if", "(", "$", "this", "->", "hasFile", "(", ")", ")", "{", "$", "...
Format form attributes form array to html. @param array $attributes @return string
[ "Format", "form", "attributes", "form", "array", "to", "html", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Form.php#L285-L299
207,440
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.makeFiles
protected function makeFiles() { $this->namespace = $this->getRootNameSpace(); $this->className = $this->getClassName(); // copy files $this->copy([ __DIR__.'/stubs/extension/view.stub' => 'resources/views/index.blade.php', __DIR__.'/stubs/extension/.g...
php
protected function makeFiles() { $this->namespace = $this->getRootNameSpace(); $this->className = $this->getClassName(); // copy files $this->copy([ __DIR__.'/stubs/extension/view.stub' => 'resources/views/index.blade.php', __DIR__.'/stubs/extension/.g...
[ "protected", "function", "makeFiles", "(", ")", "{", "$", "this", "->", "namespace", "=", "$", "this", "->", "getRootNameSpace", "(", ")", ";", "$", "this", "->", "className", "=", "$", "this", "->", "getClassName", "(", ")", ";", "// copy files", "$", ...
Make extension files.
[ "Make", "extension", "files", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L135-L188
207,441
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.getRootNameSpace
protected function getRootNameSpace() { if (!$namespace = $this->option('namespace')) { list($vendor, $name) = explode('/', $this->package); $default = str_replace(['-', '-'], '', Str::title($vendor).'\\'.Str::title($name)); $namespace = $this->ask('Root namespace', $de...
php
protected function getRootNameSpace() { if (!$namespace = $this->option('namespace')) { list($vendor, $name) = explode('/', $this->package); $default = str_replace(['-', '-'], '', Str::title($vendor).'\\'.Str::title($name)); $namespace = $this->ask('Root namespace', $de...
[ "protected", "function", "getRootNameSpace", "(", ")", "{", "if", "(", "!", "$", "namespace", "=", "$", "this", "->", "option", "(", "'namespace'", ")", ")", "{", "list", "(", "$", "vendor", ",", "$", "name", ")", "=", "explode", "(", "'/'", ",", "...
Get root namespace for this package. @return array|null|string
[ "Get", "root", "namespace", "for", "this", "package", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L195-L206
207,442
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.makeDirs
protected function makeDirs() { $this->basePath = rtrim($this->extensionDir, '/').'/'.ltrim($this->package, '/'); $this->makeDir($this->dirs); }
php
protected function makeDirs() { $this->basePath = rtrim($this->extensionDir, '/').'/'.ltrim($this->package, '/'); $this->makeDir($this->dirs); }
[ "protected", "function", "makeDirs", "(", ")", "{", "$", "this", "->", "basePath", "=", "rtrim", "(", "$", "this", "->", "extensionDir", ",", "'/'", ")", ".", "'/'", ".", "ltrim", "(", "$", "this", "->", "package", ",", "'/'", ")", ";", "$", "this"...
Create package dirs.
[ "Create", "package", "dirs", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L221-L226
207,443
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.extensionPath
protected function extensionPath($path = '') { $path = rtrim($path, '/'); if (empty($path)) { return rtrim($this->basePath, '/'); } return rtrim($this->basePath, '/').'/'.ltrim($path, '/'); }
php
protected function extensionPath($path = '') { $path = rtrim($path, '/'); if (empty($path)) { return rtrim($this->basePath, '/'); } return rtrim($this->basePath, '/').'/'.ltrim($path, '/'); }
[ "protected", "function", "extensionPath", "(", "$", "path", "=", "''", ")", "{", "$", "path", "=", "rtrim", "(", "$", "path", ",", "'/'", ")", ";", "if", "(", "empty", "(", "$", "path", ")", ")", "{", "return", "rtrim", "(", "$", "this", "->", ...
Extension path. @param string $path @return string
[ "Extension", "path", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L247-L256
207,444
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.putFile
protected function putFile($to, $content) { $to = $this->extensionPath($to); $this->filesystem->put($to, $content); }
php
protected function putFile($to, $content) { $to = $this->extensionPath($to); $this->filesystem->put($to, $content); }
[ "protected", "function", "putFile", "(", "$", "to", ",", "$", "content", ")", "{", "$", "to", "=", "$", "this", "->", "extensionPath", "(", "$", "to", ")", ";", "$", "this", "->", "filesystem", "->", "put", "(", "$", "to", ",", "$", "content", ")...
Put contents to file. @param string $to @param string $content
[ "Put", "contents", "to", "file", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L264-L269
207,445
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.copy
protected function copy($from, $to = null) { if (is_array($from) && is_null($to)) { foreach ($from as $key => $value) { $this->copy($key, $value); } return; } if (!file_exists($from)) { return; } $to = $this->...
php
protected function copy($from, $to = null) { if (is_array($from) && is_null($to)) { foreach ($from as $key => $value) { $this->copy($key, $value); } return; } if (!file_exists($from)) { return; } $to = $this->...
[ "protected", "function", "copy", "(", "$", "from", ",", "$", "to", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "from", ")", "&&", "is_null", "(", "$", "to", ")", ")", "{", "foreach", "(", "$", "from", "as", "$", "key", "=>", "$", ...
Copy files to extension path. @param string|array $from @param string|null $to
[ "Copy", "files", "to", "extension", "path", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L277-L294
207,446
z-song/laravel-admin
src/Console/ExtendCommand.php
ExtendCommand.makeDir
protected function makeDir($paths = '') { foreach ((array) $paths as $path) { $path = $this->extensionPath($path); $this->filesystem->makeDirectory($path, 0755, true, true); } }
php
protected function makeDir($paths = '') { foreach ((array) $paths as $path) { $path = $this->extensionPath($path); $this->filesystem->makeDirectory($path, 0755, true, true); } }
[ "protected", "function", "makeDir", "(", "$", "paths", "=", "''", ")", "{", "foreach", "(", "(", "array", ")", "$", "paths", "as", "$", "path", ")", "{", "$", "path", "=", "$", "this", "->", "extensionPath", "(", "$", "path", ")", ";", "$", "this...
Make new directory. @param array|string $paths
[ "Make", "new", "directory", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExtendCommand.php#L301-L308
207,447
z-song/laravel-admin
src/AdminServiceProvider.php
AdminServiceProvider.registerRouteMiddleware
protected function registerRouteMiddleware() { // register route middleware. foreach ($this->routeMiddleware as $key => $middleware) { app('router')->aliasMiddleware($key, $middleware); } // register middleware group. foreach ($this->middlewareGroups as $key => $...
php
protected function registerRouteMiddleware() { // register route middleware. foreach ($this->routeMiddleware as $key => $middleware) { app('router')->aliasMiddleware($key, $middleware); } // register middleware group. foreach ($this->middlewareGroups as $key => $...
[ "protected", "function", "registerRouteMiddleware", "(", ")", "{", "// register route middleware.", "foreach", "(", "$", "this", "->", "routeMiddleware", "as", "$", "key", "=>", "$", "middleware", ")", "{", "app", "(", "'router'", ")", "->", "aliasMiddleware", "...
Register the route middleware. @return void
[ "Register", "the", "route", "middleware", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/AdminServiceProvider.php#L121-L132
207,448
z-song/laravel-admin
src/Layout/Row.php
Row.build
public function build() { $this->startRow(); foreach ($this->columns as $column) { $column->build(); } $this->endRow(); }
php
public function build() { $this->startRow(); foreach ($this->columns as $column) { $column->build(); } $this->endRow(); }
[ "public", "function", "build", "(", ")", "{", "$", "this", "->", "startRow", "(", ")", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "column", "->", "build", "(", ")", ";", "}", "$", "this", "->", "endRow"...
Build row column.
[ "Build", "row", "column", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Layout/Row.php#L75-L84
207,449
z-song/laravel-admin
src/Layout/Content.php
Content.row
public function row($content) { if ($content instanceof Closure) { $row = new Row(); call_user_func($content, $row); $this->addRow($row); } else { $this->addRow(new Row($content)); } return $this; }
php
public function row($content) { if ($content instanceof Closure) { $row = new Row(); call_user_func($content, $row); $this->addRow($row); } else { $this->addRow(new Row($content)); } return $this; }
[ "public", "function", "row", "(", "$", "content", ")", "{", "if", "(", "$", "content", "instanceof", "Closure", ")", "{", "$", "row", "=", "new", "Row", "(", ")", ";", "call_user_func", "(", "$", "content", ",", "$", "row", ")", ";", "$", "this", ...
Add one row for content body. @param $content @return $this
[ "Add", "one", "row", "for", "content", "body", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Layout/Content.php#L132-L143
207,450
z-song/laravel-admin
src/Layout/Content.php
Content.build
public function build() { ob_start(); foreach ($this->rows as $row) { $row->build(); } $contents = ob_get_contents(); ob_end_clean(); return $contents; }
php
public function build() { ob_start(); foreach ($this->rows as $row) { $row->build(); } $contents = ob_get_contents(); ob_end_clean(); return $contents; }
[ "public", "function", "build", "(", ")", "{", "ob_start", "(", ")", ";", "foreach", "(", "$", "this", "->", "rows", "as", "$", "row", ")", "{", "$", "row", "->", "build", "(", ")", ";", "}", "$", "contents", "=", "ob_get_contents", "(", ")", ";",...
Build html of content. @return string
[ "Build", "html", "of", "content", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Layout/Content.php#L173-L186
207,451
z-song/laravel-admin
src/Grid/Row.php
Row.formatHtmlAttribute
private function formatHtmlAttribute($attributes = []) { $attrArr = []; foreach ($attributes as $name => $val) { $attrArr[] = "$name=\"$val\""; } return implode(' ', $attrArr); }
php
private function formatHtmlAttribute($attributes = []) { $attrArr = []; foreach ($attributes as $name => $val) { $attrArr[] = "$name=\"$val\""; } return implode(' ', $attrArr); }
[ "private", "function", "formatHtmlAttribute", "(", "$", "attributes", "=", "[", "]", ")", "{", "$", "attrArr", "=", "[", "]", ";", "foreach", "(", "$", "attributes", "as", "$", "name", "=>", "$", "val", ")", "{", "$", "attrArr", "[", "]", "=", "\"$...
Format attributes to html. @param array $attributes @return string
[ "Format", "attributes", "to", "html", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Row.php#L90-L98
207,452
z-song/laravel-admin
src/Grid/Row.php
Row.style
public function style($style) { if (is_array($style)) { $style = implode('', array_map(function ($key, $val) { return "$key:$val"; }, array_keys($style), array_values($style))); } if (is_string($style)) { $this->attributes['style'] = $styl...
php
public function style($style) { if (is_array($style)) { $style = implode('', array_map(function ($key, $val) { return "$key:$val"; }, array_keys($style), array_values($style))); } if (is_string($style)) { $this->attributes['style'] = $styl...
[ "public", "function", "style", "(", "$", "style", ")", "{", "if", "(", "is_array", "(", "$", "style", ")", ")", "{", "$", "style", "=", "implode", "(", "''", ",", "array_map", "(", "function", "(", "$", "key", ",", "$", "val", ")", "{", "return",...
Set style of the row. @param array|string $style
[ "Set", "style", "of", "the", "row", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Row.php#L115-L126
207,453
z-song/laravel-admin
src/Grid/Row.php
Row.output
protected function output($value) { if ($value instanceof Renderable) { $value = $value->render(); } if ($value instanceof Htmlable) { $value = $value->toHtml(); } if ($value instanceof Jsonable) { $value = $value->toJson(); } ...
php
protected function output($value) { if ($value instanceof Renderable) { $value = $value->render(); } if ($value instanceof Htmlable) { $value = $value->toHtml(); } if ($value instanceof Jsonable) { $value = $value->toJson(); } ...
[ "protected", "function", "output", "(", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "Renderable", ")", "{", "$", "value", "=", "$", "value", "->", "render", "(", ")", ";", "}", "if", "(", "$", "value", "instanceof", "Htmlable", ")"...
Output column value. @param mixed $value @return mixed|string
[ "Output", "column", "value", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Row.php#L182-L201
207,454
z-song/laravel-admin
src/Grid/Filter.php
Filter.removeFilterByID
protected function removeFilterByID($id) { $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { return $filter->getId() != $id; }); }
php
protected function removeFilterByID($id) { $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { return $filter->getId() != $id; }); }
[ "protected", "function", "removeFilterByID", "(", "$", "id", ")", "{", "$", "this", "->", "filters", "=", "array_filter", "(", "$", "this", "->", "filters", ",", "function", "(", "AbstractFilter", "$", "filter", ")", "use", "(", "$", "id", ")", "{", "r...
Remove filter by filter id. @param mixed $id
[ "Remove", "filter", "by", "filter", "id", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L280-L285
207,455
z-song/laravel-admin
src/Grid/Filter.php
Filter.addFilter
protected function addFilter(AbstractFilter $filter) { $this->layout->addFilter($filter); $filter->setParent($this); if ($this->thisFilterLayoutOnly) { $this->thisFilterLayoutOnly = false; $this->layoutOnlyFilterColumns[] = $filter->getColumn(); } r...
php
protected function addFilter(AbstractFilter $filter) { $this->layout->addFilter($filter); $filter->setParent($this); if ($this->thisFilterLayoutOnly) { $this->thisFilterLayoutOnly = false; $this->layoutOnlyFilterColumns[] = $filter->getColumn(); } r...
[ "protected", "function", "addFilter", "(", "AbstractFilter", "$", "filter", ")", "{", "$", "this", "->", "layout", "->", "addFilter", "(", "$", "filter", ")", ";", "$", "filter", "->", "setParent", "(", "$", "this", ")", ";", "if", "(", "$", "this", ...
Add a filter to grid. @param AbstractFilter $filter @return AbstractFilter
[ "Add", "a", "filter", "to", "grid", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L370-L382
207,456
z-song/laravel-admin
src/Grid/Filter.php
Filter.getCurrentScope
public function getCurrentScope() { $key = request(Scope::QUERY_NAME); return $this->scopes->first(function ($scope) use ($key) { return $scope->key == $key; }); }
php
public function getCurrentScope() { $key = request(Scope::QUERY_NAME); return $this->scopes->first(function ($scope) use ($key) { return $scope->key == $key; }); }
[ "public", "function", "getCurrentScope", "(", ")", "{", "$", "key", "=", "request", "(", "Scope", "::", "QUERY_NAME", ")", ";", "return", "$", "this", "->", "scopes", "->", "first", "(", "function", "(", "$", "scope", ")", "use", "(", "$", "key", ")"...
Get current scope. @return Scope|null
[ "Get", "current", "scope", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L434-L441
207,457
z-song/laravel-admin
src/Grid/Filter.php
Filter.column
public function column($width, \Closure $closure) { $width = $width < 1 ? round(12 * $width) : $width; $this->layout->column($width, $closure); return $this; }
php
public function column($width, \Closure $closure) { $width = $width < 1 ? round(12 * $width) : $width; $this->layout->column($width, $closure); return $this; }
[ "public", "function", "column", "(", "$", "width", ",", "\\", "Closure", "$", "closure", ")", "{", "$", "width", "=", "$", "width", "<", "1", "?", "round", "(", "12", "*", "$", "width", ")", ":", "$", "width", ";", "$", "this", "->", "layout", ...
Add a new layout column. @param int $width @param \Closure $closure @return $this
[ "Add", "a", "new", "layout", "column", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L465-L472
207,458
z-song/laravel-admin
src/Grid/Filter.php
Filter.execute
public function execute($toArray = true) { $conditions = array_merge( $this->conditions(), $this->scopeConditions() ); return $this->model->addConditions($conditions)->buildData($toArray); }
php
public function execute($toArray = true) { $conditions = array_merge( $this->conditions(), $this->scopeConditions() ); return $this->model->addConditions($conditions)->buildData($toArray); }
[ "public", "function", "execute", "(", "$", "toArray", "=", "true", ")", "{", "$", "conditions", "=", "array_merge", "(", "$", "this", "->", "conditions", "(", ")", ",", "$", "this", "->", "scopeConditions", "(", ")", ")", ";", "return", "$", "this", ...
Execute the filter with conditions. @param bool $toArray @return array|Collection|mixed
[ "Execute", "the", "filter", "with", "conditions", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L493-L501
207,459
z-song/laravel-admin
src/Grid/Filter.php
Filter.fullUrlWithoutQuery
protected function fullUrlWithoutQuery($keys) { if ($keys instanceof Arrayable) { $keys = $keys->toArray(); } $keys = (array) $keys; $request = request(); $query = $request->query(); Arr::forget($query, $keys); $question = $request->getBaseUrl(...
php
protected function fullUrlWithoutQuery($keys) { if ($keys instanceof Arrayable) { $keys = $keys->toArray(); } $keys = (array) $keys; $request = request(); $query = $request->query(); Arr::forget($query, $keys); $question = $request->getBaseUrl(...
[ "protected", "function", "fullUrlWithoutQuery", "(", "$", "keys", ")", "{", "if", "(", "$", "keys", "instanceof", "Arrayable", ")", "{", "$", "keys", "=", "$", "keys", "->", "toArray", "(", ")", ";", "}", "$", "keys", "=", "(", "array", ")", "$", "...
Get full url without query strings. @param Arrayable|array|string $keys @return string
[ "Get", "full", "url", "without", "query", "strings", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L586-L604
207,460
z-song/laravel-admin
src/Grid/Filter.php
Filter.registerFilters
public static function registerFilters() { $filters = [ 'equal' => Equal::class, 'notEqual' => NotEqual::class, 'ilike' => Ilike::class, 'like' => Like::class, 'gt' => Gt::class, 'lt' => Lt::class, ...
php
public static function registerFilters() { $filters = [ 'equal' => Equal::class, 'notEqual' => NotEqual::class, 'ilike' => Ilike::class, 'like' => Like::class, 'gt' => Gt::class, 'lt' => Lt::class, ...
[ "public", "static", "function", "registerFilters", "(", ")", "{", "$", "filters", "=", "[", "'equal'", "=>", "Equal", "::", "class", ",", "'notEqual'", "=>", "NotEqual", "::", "class", ",", "'ilike'", "=>", "Ilike", "::", "class", ",", "'like'", "=>", "L...
Register builtin filters.
[ "Register", "builtin", "filters", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L635-L662
207,461
z-song/laravel-admin
src/Grid/Tools.php
Tools.disableFilterButton
public function disableFilterButton(bool $disable = true) { $this->tools = $this->tools->map(function ($tool) use ($disable) { if ($tool instanceof FilterButton) { return $tool->disable($disable); } return $tool; }); }
php
public function disableFilterButton(bool $disable = true) { $this->tools = $this->tools->map(function ($tool) use ($disable) { if ($tool instanceof FilterButton) { return $tool->disable($disable); } return $tool; }); }
[ "public", "function", "disableFilterButton", "(", "bool", "$", "disable", "=", "true", ")", "{", "$", "this", "->", "tools", "=", "$", "this", "->", "tools", "->", "map", "(", "function", "(", "$", "tool", ")", "use", "(", "$", "disable", ")", "{", ...
Disable filter button. @return void
[ "Disable", "filter", "button", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools.php#L86-L95
207,462
z-song/laravel-admin
src/Grid/Tools.php
Tools.disableRefreshButton
public function disableRefreshButton(bool $disable = true) { $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) { if ($tool instanceof RefreshButton) { return $tool->disable($disable); } return $tool; }); }
php
public function disableRefreshButton(bool $disable = true) { $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) { if ($tool instanceof RefreshButton) { return $tool->disable($disable); } return $tool; }); }
[ "public", "function", "disableRefreshButton", "(", "bool", "$", "disable", "=", "true", ")", "{", "$", "this", "->", "tools", "=", "$", "this", "->", "tools", "->", "map", "(", "function", "(", "AbstractTool", "$", "tool", ")", "use", "(", "$", "disabl...
Disable refresh button. @return void
[ "Disable", "refresh", "button", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools.php#L102-L111
207,463
z-song/laravel-admin
src/Grid/Tools.php
Tools.disableBatchActions
public function disableBatchActions(bool $disable = true) { $this->tools = $this->tools->map(function ($tool) use ($disable) { if ($tool instanceof BatchActions) { return $tool->disable($disable); } return $tool; }); }
php
public function disableBatchActions(bool $disable = true) { $this->tools = $this->tools->map(function ($tool) use ($disable) { if ($tool instanceof BatchActions) { return $tool->disable($disable); } return $tool; }); }
[ "public", "function", "disableBatchActions", "(", "bool", "$", "disable", "=", "true", ")", "{", "$", "this", "->", "tools", "=", "$", "this", "->", "tools", "->", "map", "(", "function", "(", "$", "tool", ")", "use", "(", "$", "disable", ")", "{", ...
Disable batch actions. @return void
[ "Disable", "batch", "actions", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools.php#L118-L127
207,464
z-song/laravel-admin
src/Form/Tab.php
Tab.append
public function append($title, \Closure $content, $active = false) { $fields = $this->collectFields($content); $id = 'form-'.($this->tabs->count() + 1); $this->tabs->push(compact('id', 'title', 'fields', 'active')); return $this; }
php
public function append($title, \Closure $content, $active = false) { $fields = $this->collectFields($content); $id = 'form-'.($this->tabs->count() + 1); $this->tabs->push(compact('id', 'title', 'fields', 'active')); return $this; }
[ "public", "function", "append", "(", "$", "title", ",", "\\", "Closure", "$", "content", ",", "$", "active", "=", "false", ")", "{", "$", "fields", "=", "$", "this", "->", "collectFields", "(", "$", "content", ")", ";", "$", "id", "=", "'form-'", "...
Append a tab section. @param string $title @param \Closure $content @param bool $active @return $this
[ "Append", "a", "tab", "section", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tab.php#L46-L55
207,465
z-song/laravel-admin
src/Form/Tab.php
Tab.getTabs
public function getTabs() { // If there is no active tab, then active the first. if ($this->tabs->filter(function ($tab) { return $tab['active']; })->isEmpty()) { $first = $this->tabs->first(); $first['active'] = true; $this->tabs->offsetSet(0...
php
public function getTabs() { // If there is no active tab, then active the first. if ($this->tabs->filter(function ($tab) { return $tab['active']; })->isEmpty()) { $first = $this->tabs->first(); $first['active'] = true; $this->tabs->offsetSet(0...
[ "public", "function", "getTabs", "(", ")", "{", "// If there is no active tab, then active the first.", "if", "(", "$", "this", "->", "tabs", "->", "filter", "(", "function", "(", "$", "tab", ")", "{", "return", "$", "tab", "[", "'active'", "]", ";", "}", ...
Get all tabs. @return Collection
[ "Get", "all", "tabs", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tab.php#L104-L117
207,466
z-song/laravel-admin
src/Form/Tools.php
Tools.disableView
public function disableView(bool $disable = true) { if ($disable) { array_delete($this->tools, 'view'); } elseif (!in_array('view', $this->tools)) { array_push($this->tools, 'view'); } return $this; }
php
public function disableView(bool $disable = true) { if ($disable) { array_delete($this->tools, 'view'); } elseif (!in_array('view', $this->tools)) { array_push($this->tools, 'view'); } return $this; }
[ "public", "function", "disableView", "(", "bool", "$", "disable", "=", "true", ")", "{", "if", "(", "$", "disable", ")", "{", "array_delete", "(", "$", "this", "->", "tools", ",", "'view'", ")", ";", "}", "elseif", "(", "!", "in_array", "(", "'view'"...
Disable `edit` tool. @return $this
[ "Disable", "edit", "tool", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tools.php#L115-L124
207,467
z-song/laravel-admin
src/Extension.php
Extension.getInstance
protected static function getInstance() { $class = get_called_class(); if (!isset(self::$instance[$class]) || !self::$instance[$class] instanceof $class) { self::$instance[$class] = new static(); } return static::$instance[$class]; }
php
protected static function getInstance() { $class = get_called_class(); if (!isset(self::$instance[$class]) || !self::$instance[$class] instanceof $class) { self::$instance[$class] = new static(); } return static::$instance[$class]; }
[ "protected", "static", "function", "getInstance", "(", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "instance", "[", "$", "class", "]", ")", "||", "!", "self", "::", "$", "instance",...
Returns the singleton instance. @return self
[ "Returns", "the", "singleton", "instance", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L85-L94
207,468
z-song/laravel-admin
src/Extension.php
Extension.boot
public static function boot() { $extension = static::getInstance(); Admin::extend($extension->name, get_called_class()); if ($extension->disabled()) { return false; } if (!empty($css = $extension->css())) { Admin::css($css); } if (!...
php
public static function boot() { $extension = static::getInstance(); Admin::extend($extension->name, get_called_class()); if ($extension->disabled()) { return false; } if (!empty($css = $extension->css())) { Admin::css($css); } if (!...
[ "public", "static", "function", "boot", "(", ")", "{", "$", "extension", "=", "static", "::", "getInstance", "(", ")", ";", "Admin", "::", "extend", "(", "$", "extension", "->", "name", ",", "get_called_class", "(", ")", ")", ";", "if", "(", "$", "ex...
Bootstrap this extension.
[ "Bootstrap", "this", "extension", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L99-L118
207,469
z-song/laravel-admin
src/Extension.php
Extension.import
public static function import() { $extension = static::getInstance(); if ($menu = $extension->menu()) { if ($extension->validateMenu($menu)) { extract($menu); static::createMenu($title, $path, $icon); } } if ($permission = $ex...
php
public static function import() { $extension = static::getInstance(); if ($menu = $extension->menu()) { if ($extension->validateMenu($menu)) { extract($menu); static::createMenu($title, $path, $icon); } } if ($permission = $ex...
[ "public", "static", "function", "import", "(", ")", "{", "$", "extension", "=", "static", "::", "getInstance", "(", ")", ";", "if", "(", "$", "menu", "=", "$", "extension", "->", "menu", "(", ")", ")", "{", "if", "(", "$", "extension", "->", "valid...
Import menu item and permission to laravel-admin.
[ "Import", "menu", "item", "and", "permission", "to", "laravel", "-", "admin", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L230-L247
207,470
z-song/laravel-admin
src/Extension.php
Extension.validateMenu
public function validateMenu(array $menu) { /** @var \Illuminate\Validation\Validator $validator */ $validator = Validator::make($menu, $this->menuValidationRules); if ($validator->passes()) { return true; } $message = "Invalid menu:\r\n".implode("\r\n", Arr::fl...
php
public function validateMenu(array $menu) { /** @var \Illuminate\Validation\Validator $validator */ $validator = Validator::make($menu, $this->menuValidationRules); if ($validator->passes()) { return true; } $message = "Invalid menu:\r\n".implode("\r\n", Arr::fl...
[ "public", "function", "validateMenu", "(", "array", "$", "menu", ")", "{", "/** @var \\Illuminate\\Validation\\Validator $validator */", "$", "validator", "=", "Validator", "::", "make", "(", "$", "menu", ",", "$", "this", "->", "menuValidationRules", ")", ";", "i...
Validate menu fields. @param array $menu @throws \Exception @return bool
[ "Validate", "menu", "fields", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L258-L270
207,471
z-song/laravel-admin
src/Extension.php
Extension.validatePermission
public function validatePermission(array $permission) { /** @var \Illuminate\Validation\Validator $validator */ $validator = Validator::make($permission, $this->permissionValidationRules); if ($validator->passes()) { return true; } $message = "Invalid permission...
php
public function validatePermission(array $permission) { /** @var \Illuminate\Validation\Validator $validator */ $validator = Validator::make($permission, $this->permissionValidationRules); if ($validator->passes()) { return true; } $message = "Invalid permission...
[ "public", "function", "validatePermission", "(", "array", "$", "permission", ")", "{", "/** @var \\Illuminate\\Validation\\Validator $validator */", "$", "validator", "=", "Validator", "::", "make", "(", "$", "permission", ",", "$", "this", "->", "permissionValidationRu...
Validate permission fields. @param array $permission @throws \Exception @return bool
[ "Validate", "permission", "fields", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L281-L293
207,472
z-song/laravel-admin
src/Extension.php
Extension.createMenu
protected static function createMenu($title, $uri, $icon = 'fa-bars', $parentId = 0) { $menuModel = config('admin.database.menu_model'); $lastOrder = $menuModel::max('order'); $menuModel::create([ 'parent_id' => $parentId, 'order' => $lastOrder + 1, ...
php
protected static function createMenu($title, $uri, $icon = 'fa-bars', $parentId = 0) { $menuModel = config('admin.database.menu_model'); $lastOrder = $menuModel::max('order'); $menuModel::create([ 'parent_id' => $parentId, 'order' => $lastOrder + 1, ...
[ "protected", "static", "function", "createMenu", "(", "$", "title", ",", "$", "uri", ",", "$", "icon", "=", "'fa-bars'", ",", "$", "parentId", "=", "0", ")", "{", "$", "menuModel", "=", "config", "(", "'admin.database.menu_model'", ")", ";", "$", "lastOr...
Create a item in laravel-admin left side menu. @param string $title @param string $uri @param string $icon @param int $parentId
[ "Create", "a", "item", "in", "laravel", "-", "admin", "left", "side", "menu", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L303-L316
207,473
z-song/laravel-admin
src/Extension.php
Extension.createPermission
protected static function createPermission($name, $slug, $path) { $permissionModel = config('admin.database.permissions_model'); $permissionModel::create([ 'name' => $name, 'slug' => $slug, 'http_path' => '/'.trim($path, '/'), ]); }
php
protected static function createPermission($name, $slug, $path) { $permissionModel = config('admin.database.permissions_model'); $permissionModel::create([ 'name' => $name, 'slug' => $slug, 'http_path' => '/'.trim($path, '/'), ]); }
[ "protected", "static", "function", "createPermission", "(", "$", "name", ",", "$", "slug", ",", "$", "path", ")", "{", "$", "permissionModel", "=", "config", "(", "'admin.database.permissions_model'", ")", ";", "$", "permissionModel", "::", "create", "(", "[",...
Create a permission for this extension. @param $name @param $slug @param $path
[ "Create", "a", "permission", "for", "this", "extension", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L325-L334
207,474
z-song/laravel-admin
src/Extension.php
Extension.routes
public static function routes($callback) { $attributes = array_merge( [ 'prefix' => config('admin.route.prefix'), 'middleware' => config('admin.route.middleware'), ], static::config('route', []) ); Route::group($attribu...
php
public static function routes($callback) { $attributes = array_merge( [ 'prefix' => config('admin.route.prefix'), 'middleware' => config('admin.route.middleware'), ], static::config('route', []) ); Route::group($attribu...
[ "public", "static", "function", "routes", "(", "$", "callback", ")", "{", "$", "attributes", "=", "array_merge", "(", "[", "'prefix'", "=>", "config", "(", "'admin.route.prefix'", ")", ",", "'middleware'", "=>", "config", "(", "'admin.route.middleware'", ")", ...
Set routes for this extension. @param $callback
[ "Set", "routes", "for", "this", "extension", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L341-L352
207,475
z-song/laravel-admin
src/Console/ResourceGenerator.php
ResourceGenerator.getTableColumns
protected function getTableColumns() { if (!$this->model->getConnection()->isDoctrineAvailable()) { throw new \Exception( 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. ' ); } $table = $this->model->getConn...
php
protected function getTableColumns() { if (!$this->model->getConnection()->isDoctrineAvailable()) { throw new \Exception( 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. ' ); } $table = $this->model->getConn...
[ "protected", "function", "getTableColumns", "(", ")", "{", "if", "(", "!", "$", "this", "->", "model", "->", "getConnection", "(", ")", "->", "isDoctrineAvailable", "(", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'You need to require doctrine/dbal...
Get columns of a giving model. @throws \Exception @return \Doctrine\DBAL\Schema\Column[]
[ "Get", "columns", "of", "a", "giving", "model", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ResourceGenerator.php#L214-L241
207,476
z-song/laravel-admin
src/Form/Field.php
Field.formatLabel
protected function formatLabel($arguments = []) { $column = is_array($this->column) ? current($this->column) : $this->column; $label = isset($arguments[0]) ? $arguments[0] : ucfirst($column); return str_replace(['.', '_'], ' ', $label); }
php
protected function formatLabel($arguments = []) { $column = is_array($this->column) ? current($this->column) : $this->column; $label = isset($arguments[0]) ? $arguments[0] : ucfirst($column); return str_replace(['.', '_'], ' ', $label); }
[ "protected", "function", "formatLabel", "(", "$", "arguments", "=", "[", "]", ")", "{", "$", "column", "=", "is_array", "(", "$", "this", "->", "column", ")", "?", "current", "(", "$", "this", "->", "column", ")", ":", "$", "this", "->", "column", ...
Format the label value. @param array $arguments @return string
[ "Format", "the", "label", "value", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L273-L280
207,477
z-song/laravel-admin
src/Form/Field.php
Field.checked
public function checked($checked = []) { if ($checked instanceof Arrayable) { $checked = $checked->toArray(); } $this->checked = array_merge($this->checked, $checked); return $this; }
php
public function checked($checked = []) { if ($checked instanceof Arrayable) { $checked = $checked->toArray(); } $this->checked = array_merge($this->checked, $checked); return $this; }
[ "public", "function", "checked", "(", "$", "checked", "=", "[", "]", ")", "{", "if", "(", "$", "checked", "instanceof", "Arrayable", ")", "{", "$", "checked", "=", "$", "checked", "->", "toArray", "(", ")", ";", "}", "$", "this", "->", "checked", "...
Set the field option checked. @param array $checked @return $this
[ "Set", "the", "field", "option", "checked", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L453-L462
207,478
z-song/laravel-admin
src/Form/Field.php
Field.addRequiredAttribute
protected function addRequiredAttribute($rules) { if (!in_array('required', $rules)) { return; } if ($this instanceof Form\Field\MultipleFile || $this instanceof Form\Field\File) { return; } $this->required(); }
php
protected function addRequiredAttribute($rules) { if (!in_array('required', $rules)) { return; } if ($this instanceof Form\Field\MultipleFile || $this instanceof Form\Field\File) { return; } $this->required(); }
[ "protected", "function", "addRequiredAttribute", "(", "$", "rules", ")", "{", "if", "(", "!", "in_array", "(", "'required'", ",", "$", "rules", ")", ")", "{", "return", ";", "}", "if", "(", "$", "this", "instanceof", "Form", "\\", "Field", "\\", "Multi...
Add `required` attribute to current field if has required rule, except file and image fields. @param array $rules
[ "Add", "required", "attribute", "to", "current", "field", "if", "has", "required", "rule", "except", "file", "and", "image", "fields", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L470-L482
207,479
z-song/laravel-admin
src/Form/Field.php
Field.getRules
protected function getRules() { if ($this->rules instanceof \Closure) { return $this->rules->call($this, $this->form); } return $this->rules; }
php
protected function getRules() { if ($this->rules instanceof \Closure) { return $this->rules->call($this, $this->form); } return $this->rules; }
[ "protected", "function", "getRules", "(", ")", "{", "if", "(", "$", "this", "->", "rules", "instanceof", "\\", "Closure", ")", "{", "return", "$", "this", "->", "rules", "->", "call", "(", "$", "this", ",", "$", "this", "->", "form", ")", ";", "}",...
Get field validation rules. @return string
[ "Get", "field", "validation", "rules", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L522-L529
207,480
z-song/laravel-admin
src/Form/Field.php
Field.removeRule
protected function removeRule($rule) { if (!is_string($this->rules)) { return; } $pattern = "/{$rule}[^\|]?(\||$)/"; $this->rules = preg_replace($pattern, '', $this->rules, -1); }
php
protected function removeRule($rule) { if (!is_string($this->rules)) { return; } $pattern = "/{$rule}[^\|]?(\||$)/"; $this->rules = preg_replace($pattern, '', $this->rules, -1); }
[ "protected", "function", "removeRule", "(", "$", "rule", ")", "{", "if", "(", "!", "is_string", "(", "$", "this", "->", "rules", ")", ")", "{", "return", ";", "}", "$", "pattern", "=", "\"/{$rule}[^\\|]?(\\||$)/\"", ";", "$", "this", "->", "rules", "="...
Remove a specific rule by keyword. @param string $rule @return void
[ "Remove", "a", "specific", "rule", "by", "keyword", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L538-L546
207,481
z-song/laravel-admin
src/Form/Field.php
Field.data
public function data(array $data = null) { if (is_null($data)) { return $this->data; } $this->data = $data; return $this; }
php
public function data(array $data = null) { if (is_null($data)) { return $this->data; } $this->data = $data; return $this; }
[ "public", "function", "data", "(", "array", "$", "data", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "return", "$", "this", "->", "data", ";", "}", "$", "this", "->", "data", "=", "$", "data", ";", "return", "$...
Set or get data. @param array $data @return $this
[ "Set", "or", "get", "data", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L611-L620
207,482
z-song/laravel-admin
src/Form/Field.php
Field.attribute
public function attribute($attribute, $value = null) { if (is_array($attribute)) { $this->attributes = array_merge($this->attributes, $attribute); } else { $this->attributes[$attribute] = (string) $value; } return $this; }
php
public function attribute($attribute, $value = null) { if (is_array($attribute)) { $this->attributes = array_merge($this->attributes, $attribute); } else { $this->attributes[$attribute] = (string) $value; } return $this; }
[ "public", "function", "attribute", "(", "$", "attribute", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "attribute", ")", ")", "{", "$", "this", "->", "attributes", "=", "array_merge", "(", "$", "this", "->", "attributes", ...
Add html attributes to elements. @param array|string $attribute @param mixed $value @return $this
[ "Add", "html", "attributes", "to", "elements", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L765-L774
207,483
z-song/laravel-admin
src/Form/Field.php
Field.formatAttributes
protected function formatAttributes() { $html = []; foreach ($this->attributes as $name => $value) { $html[] = $name.'="'.e($value).'"'; } return implode(' ', $html); }
php
protected function formatAttributes() { $html = []; foreach ($this->attributes as $name => $value) { $html[] = $name.'="'.e($value).'"'; } return implode(' ', $html); }
[ "protected", "function", "formatAttributes", "(", ")", "{", "$", "html", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "attributes", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "html", "[", "]", "=", "$", "name", ".", "'=\"'", ...
Format the field attributes. @return string
[ "Format", "the", "field", "attributes", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L875-L884
207,484
z-song/laravel-admin
src/Form/Field.php
Field.getElementClass
protected function getElementClass() { if (!$this->elementClass) { $name = $this->elementName ?: $this->formatName($this->column); $this->elementClass = (array) str_replace(['[', ']'], '_', $name); } return $this->elementClass; }
php
protected function getElementClass() { if (!$this->elementClass) { $name = $this->elementName ?: $this->formatName($this->column); $this->elementClass = (array) str_replace(['[', ']'], '_', $name); } return $this->elementClass; }
[ "protected", "function", "getElementClass", "(", ")", "{", "if", "(", "!", "$", "this", "->", "elementClass", ")", "{", "$", "name", "=", "$", "this", "->", "elementName", "?", ":", "$", "this", "->", "formatName", "(", "$", "this", "->", "column", "...
Get element class. @return array
[ "Get", "element", "class", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L931-L940
207,485
z-song/laravel-admin
src/Form/Field.php
Field.getElementClassString
protected function getElementClassString() { $elementClass = $this->getElementClass(); if (Arr::isAssoc($elementClass)) { $classes = []; foreach ($elementClass as $index => $class) { $classes[$index] = is_array($class) ? implode(' ', $class) : $class; ...
php
protected function getElementClassString() { $elementClass = $this->getElementClass(); if (Arr::isAssoc($elementClass)) { $classes = []; foreach ($elementClass as $index => $class) { $classes[$index] = is_array($class) ? implode(' ', $class) : $class; ...
[ "protected", "function", "getElementClassString", "(", ")", "{", "$", "elementClass", "=", "$", "this", "->", "getElementClass", "(", ")", ";", "if", "(", "Arr", "::", "isAssoc", "(", "$", "elementClass", ")", ")", "{", "$", "classes", "=", "[", "]", "...
Get element class string. @return mixed
[ "Get", "element", "class", "string", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L947-L962
207,486
z-song/laravel-admin
src/Form/Field.php
Field.addElementClass
public function addElementClass($class) { if (is_array($class) || is_string($class)) { $this->elementClass = array_merge($this->elementClass, (array) $class); $this->elementClass = array_unique($this->elementClass); } return $this; }
php
public function addElementClass($class) { if (is_array($class) || is_string($class)) { $this->elementClass = array_merge($this->elementClass, (array) $class); $this->elementClass = array_unique($this->elementClass); } return $this; }
[ "public", "function", "addElementClass", "(", "$", "class", ")", "{", "if", "(", "is_array", "(", "$", "class", ")", "||", "is_string", "(", "$", "class", ")", ")", "{", "$", "this", "->", "elementClass", "=", "array_merge", "(", "$", "this", "->", "...
Add the element class. @param $class @return $this
[ "Add", "the", "element", "class", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L993-L1002
207,487
z-song/laravel-admin
src/Form/Field.php
Field.resetElementClassName
public function resetElementClassName(string $className, string $resetClassName) { if (($key = array_search($className, $this->getElementClass())) !== false) { $this->elementClass[$key] = $resetClassName; } return $this; }
php
public function resetElementClassName(string $className, string $resetClassName) { if (($key = array_search($className, $this->getElementClass())) !== false) { $this->elementClass[$key] = $resetClassName; } return $this; }
[ "public", "function", "resetElementClassName", "(", "string", "$", "className", ",", "string", "$", "resetClassName", ")", "{", "if", "(", "(", "$", "key", "=", "array_search", "(", "$", "className", ",", "$", "this", "->", "getElementClass", "(", ")", ")"...
reset field className. @param string $className @param string $resetClassName @return $this
[ "reset", "field", "className", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L1062-L1069
207,488
z-song/laravel-admin
src/Form/Field.php
Field.variables
public function variables() { return array_merge($this->variables, [ 'id' => $this->id, 'name' => $this->elementName ?: $this->formatName($this->column), 'help' => $this->help, 'class' => $this->getElementClassString(), ...
php
public function variables() { return array_merge($this->variables, [ 'id' => $this->id, 'name' => $this->elementName ?: $this->formatName($this->column), 'help' => $this->help, 'class' => $this->getElementClassString(), ...
[ "public", "function", "variables", "(", ")", "{", "return", "array_merge", "(", "$", "this", "->", "variables", ",", "[", "'id'", "=>", "$", "this", "->", "id", ",", "'name'", "=>", "$", "this", "->", "elementName", "?", ":", "$", "this", "->", "form...
Get the view variables of this field. @return array
[ "Get", "the", "view", "variables", "of", "this", "field", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L1112-L1127
207,489
z-song/laravel-admin
src/Form/Field/Radio.php
Radio.checked
public function checked($checked = []) { if ($checked instanceof Arrayable) { $checked = $checked->toArray(); } // input radio checked should be unique $this->checked = is_array($checked) ? (array) end($checked) : (array) $checked; return $this; }
php
public function checked($checked = []) { if ($checked instanceof Arrayable) { $checked = $checked->toArray(); } // input radio checked should be unique $this->checked = is_array($checked) ? (array) end($checked) : (array) $checked; return $this; }
[ "public", "function", "checked", "(", "$", "checked", "=", "[", "]", ")", "{", "if", "(", "$", "checked", "instanceof", "Arrayable", ")", "{", "$", "checked", "=", "$", "checked", "->", "toArray", "(", ")", ";", "}", "// input radio checked should be uniqu...
Set checked. @param array|callable|string $checked @return $this
[ "Set", "checked", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Radio.php#L45-L55
207,490
z-song/laravel-admin
src/Form/Field/Text.php
Text.json_encode_options
protected function json_encode_options($options) { $data = $this->prepare_options($options); $json = json_encode($data['options']); $json = str_replace($data['toReplace'], $data['original'], $json); return $json; }
php
protected function json_encode_options($options) { $data = $this->prepare_options($options); $json = json_encode($data['options']); $json = str_replace($data['toReplace'], $data['original'], $json); return $json; }
[ "protected", "function", "json_encode_options", "(", "$", "options", ")", "{", "$", "data", "=", "$", "this", "->", "prepare_options", "(", "$", "options", ")", ";", "$", "json", "=", "json_encode", "(", "$", "data", "[", "'options'", "]", ")", ";", "$...
Encode options to Json. @param array $options @return $json
[ "Encode", "options", "to", "Json", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Text.php#L78-L87
207,491
z-song/laravel-admin
src/Form/Field/Text.php
Text.datalist
public function datalist($entries = []) { $this->defaultAttribute('list', "list-{$this->id}"); $datalist = "<datalist id=\"list-{$this->id}\">"; foreach ($entries as $k => $v) { $datalist .= "<option value=\"{$k}\">{$v}</option>"; } $datalist .= '</datalist>'; ...
php
public function datalist($entries = []) { $this->defaultAttribute('list', "list-{$this->id}"); $datalist = "<datalist id=\"list-{$this->id}\">"; foreach ($entries as $k => $v) { $datalist .= "<option value=\"{$k}\">{$v}</option>"; } $datalist .= '</datalist>'; ...
[ "public", "function", "datalist", "(", "$", "entries", "=", "[", "]", ")", "{", "$", "this", "->", "defaultAttribute", "(", "'list'", ",", "\"list-{$this->id}\"", ")", ";", "$", "datalist", "=", "\"<datalist id=\\\"list-{$this->id}\\\">\"", ";", "foreach", "(", ...
Add datalist element to Text input. @param array $entries @return $this
[ "Add", "datalist", "element", "to", "Text", "input", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Text.php#L124-L135
207,492
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.initialize
protected function initialize() { $this->id = $this->formatId($this->column); $this->group = new Collection(); $this->name = "{$this->id}-filter-group"; $this->setupDefaultPresenter(); }
php
protected function initialize() { $this->id = $this->formatId($this->column); $this->group = new Collection(); $this->name = "{$this->id}-filter-group"; $this->setupDefaultPresenter(); }
[ "protected", "function", "initialize", "(", ")", "{", "$", "this", "->", "id", "=", "$", "this", "->", "formatId", "(", "$", "this", "->", "column", ")", ";", "$", "this", "->", "group", "=", "new", "Collection", "(", ")", ";", "$", "this", "->", ...
Initialize a group filter.
[ "Initialize", "a", "group", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L53-L60
207,493
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.equal
public function equal($label = '', $operator = '=') { $label = $label ?: $operator; $condition = [$this->column, $operator, $this->value]; return $this->joinGroup($label, $condition); }
php
public function equal($label = '', $operator = '=') { $label = $label ?: $operator; $condition = [$this->column, $operator, $this->value]; return $this->joinGroup($label, $condition); }
[ "public", "function", "equal", "(", "$", "label", "=", "''", ",", "$", "operator", "=", "'='", ")", "{", "$", "label", "=", "$", "label", "?", ":", "$", "operator", ";", "$", "condition", "=", "[", "$", "this", "->", "column", ",", "$", "operator...
Filter out `equal` records. @param string $label @param string $operator @return Group
[ "Filter", "out", "equal", "records", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L87-L94
207,494
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.where
public function where($label, \Closure $builder) { $this->input = $this->value; $condition = [$builder->bindTo($this)]; return $this->joinGroup($label, $condition); }
php
public function where($label, \Closure $builder) { $this->input = $this->value; $condition = [$builder->bindTo($this)]; return $this->joinGroup($label, $condition); }
[ "public", "function", "where", "(", "$", "label", ",", "\\", "Closure", "$", "builder", ")", "{", "$", "this", "->", "input", "=", "$", "this", "->", "value", ";", "$", "condition", "=", "[", "$", "builder", "->", "bindTo", "(", "$", "this", ")", ...
Specify a where query. @param string $label @param \Closure $builder @return Group
[ "Specify", "a", "where", "query", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L178-L185
207,495
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.like
public function like($label = '', $operator = 'like') { $label = $label ?: $operator; $condition = [$this->column, $operator, "%{$this->value}%"]; return $this->joinGroup($label, $condition); }
php
public function like($label = '', $operator = 'like') { $label = $label ?: $operator; $condition = [$this->column, $operator, "%{$this->value}%"]; return $this->joinGroup($label, $condition); }
[ "public", "function", "like", "(", "$", "label", "=", "''", ",", "$", "operator", "=", "'like'", ")", "{", "$", "label", "=", "$", "label", "?", ":", "$", "operator", ";", "$", "condition", "=", "[", "$", "this", "->", "column", ",", "$", "operat...
Specify a where like query. @param string $label @param string $operator @return Group
[ "Specify", "a", "where", "like", "query", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L195-L202
207,496
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.startWith
public function startWith($label = '') { $label = $label ?: 'Start with'; $condition = [$this->column, 'like', "{$this->value}%"]; return $this->joinGroup($label, $condition); }
php
public function startWith($label = '') { $label = $label ?: 'Start with'; $condition = [$this->column, 'like', "{$this->value}%"]; return $this->joinGroup($label, $condition); }
[ "public", "function", "startWith", "(", "$", "label", "=", "''", ")", "{", "$", "label", "=", "$", "label", "?", ":", "'Start with'", ";", "$", "condition", "=", "[", "$", "this", "->", "column", ",", "'like'", ",", "\"{$this->value}%\"", "]", ";", "...
Filter out records which starts with input query. @param string $label @return Group
[ "Filter", "out", "records", "which", "starts", "with", "input", "query", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L235-L242
207,497
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.endWith
public function endWith($label = '') { $label = $label ?: 'End with'; $condition = [$this->column, 'like', "%{$this->value}"]; return $this->joinGroup($label, $condition); }
php
public function endWith($label = '') { $label = $label ?: 'End with'; $condition = [$this->column, 'like', "%{$this->value}"]; return $this->joinGroup($label, $condition); }
[ "public", "function", "endWith", "(", "$", "label", "=", "''", ")", "{", "$", "label", "=", "$", "label", "?", ":", "'End with'", ";", "$", "condition", "=", "[", "$", "this", "->", "column", ",", "'like'", ",", "\"%{$this->value}\"", "]", ";", "retu...
Filter out records which ends with input query. @param string $label @return Group
[ "Filter", "out", "records", "which", "ends", "with", "input", "query", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L251-L258
207,498
z-song/laravel-admin
src/Form/Field/MultipleFile.php
MultipleFile.hydrateFiles
protected function hydrateFiles(array $value) { if (empty($value)) { return [[$this->column => $this->getRules()], []]; } $rules = $input = []; foreach ($value as $key => $file) { $rules[$this->column.$key] = $this->getRules(); $input[$this->colu...
php
protected function hydrateFiles(array $value) { if (empty($value)) { return [[$this->column => $this->getRules()], []]; } $rules = $input = []; foreach ($value as $key => $file) { $rules[$this->column.$key] = $this->getRules(); $input[$this->colu...
[ "protected", "function", "hydrateFiles", "(", "array", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "return", "[", "[", "$", "this", "->", "column", "=>", "$", "this", "->", "getRules", "(", ")", "]", ",", "[", "]...
Hydrate the files array. @param array $value @return array
[ "Hydrate", "the", "files", "array", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/MultipleFile.php#L94-L108
207,499
z-song/laravel-admin
src/Grid/Displayers/Actions.php
Actions.disableView
public function disableView(bool $disable = true) { if ($disable) { array_delete($this->actions, 'view'); } elseif (!in_array('view', $this->actions)) { array_push($this->actions, 'view'); } return $this; }
php
public function disableView(bool $disable = true) { if ($disable) { array_delete($this->actions, 'view'); } elseif (!in_array('view', $this->actions)) { array_push($this->actions, 'view'); } return $this; }
[ "public", "function", "disableView", "(", "bool", "$", "disable", "=", "true", ")", "{", "if", "(", "$", "disable", ")", "{", "array_delete", "(", "$", "this", "->", "actions", ",", "'view'", ")", ";", "}", "elseif", "(", "!", "in_array", "(", "'view...
Disable view action. @return $this
[ "Disable", "view", "action", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Displayers/Actions.php#L74-L83