repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
LaravelRUS/SleepingOwlAdmin | src/Form/FormDefault.php | FormDefault.toArray | public function toArray()
{
// This element needs only in template
$this->setHtmlAttribute('method', 'POST');
$this->setHtmlAttribute('action', $this->getAction());
return [
'items' => $this->getElements()->onlyVisible(),
'instance' => $this->getModel(),
... | php | public function toArray()
{
// This element needs only in template
$this->setHtmlAttribute('method', 'POST');
$this->setHtmlAttribute('action', $this->getAction());
return [
'items' => $this->getElements()->onlyVisible(),
'instance' => $this->getModel(),
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"// This element needs only in template",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'method'",
",",
"'POST'",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'action'",
",",
"$",
"this",
"->",
"getAction"... | Get the instance as an array.
@return array | [
"Get",
"the",
"instance",
"as",
"an",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormDefault.php#L415-L428 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Filter/BaseColumnFilter.php | BaseColumnFilter.apply | public function apply(ColumnInterface $column, Builder $query, $queryString, $queryParams)
{
$queryString = $this->parseValue($queryString);
if (($metaInstance = $column->getMetaData()) instanceof ColumnMetaInterface) {
if (method_exists($metaInstance, 'onFilterSearch')) {
... | php | public function apply(ColumnInterface $column, Builder $query, $queryString, $queryParams)
{
$queryString = $this->parseValue($queryString);
if (($metaInstance = $column->getMetaData()) instanceof ColumnMetaInterface) {
if (method_exists($metaInstance, 'onFilterSearch')) {
... | [
"public",
"function",
"apply",
"(",
"ColumnInterface",
"$",
"column",
",",
"Builder",
"$",
"query",
",",
"$",
"queryString",
",",
"$",
"queryParams",
")",
"{",
"$",
"queryString",
"=",
"$",
"this",
"->",
"parseValue",
"(",
"$",
"queryString",
")",
";",
"... | @param ColumnInterface $column
@param Builder $query
@param string $queryString
@param array|string $queryParams
@return void | [
"@param",
"ColumnInterface",
"$column",
"@param",
"Builder",
"$query",
"@param",
"string",
"$queryString",
"@param",
"array|string",
"$queryParams"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Filter/BaseColumnFilter.php#L103-L146 |
LaravelRUS/SleepingOwlAdmin | src/Configuration/ProvidesScriptVariables.php | ProvidesScriptVariables.scriptVariables | public function scriptVariables()
{
$lang = trans('sleeping_owl::lang');
if ($lang == 'sleeping_owl::lang') {
$lang = trans('sleeping_owl::lang', [], 'en');
}
return [
'debug' => config('app.debug'),
'env' => $this->app->environment(),
... | php | public function scriptVariables()
{
$lang = trans('sleeping_owl::lang');
if ($lang == 'sleeping_owl::lang') {
$lang = trans('sleeping_owl::lang', [], 'en');
}
return [
'debug' => config('app.debug'),
'env' => $this->app->environment(),
... | [
"public",
"function",
"scriptVariables",
"(",
")",
"{",
"$",
"lang",
"=",
"trans",
"(",
"'sleeping_owl::lang'",
")",
";",
"if",
"(",
"$",
"lang",
"==",
"'sleeping_owl::lang'",
")",
"{",
"$",
"lang",
"=",
"trans",
"(",
"'sleeping_owl::lang'",
",",
"[",
"]",... | Получение массива глобальных
переменных
для JavaScript.
@return array | [
"Получение",
"массива",
"глобальных",
"переменных",
"для",
"JavaScript",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Configuration/ProvidesScriptVariables.php#L16-L33 |
LaravelRUS/SleepingOwlAdmin | src/Traits/SelectOptionsFromModel.php | SelectOptionsFromModel.setModelForOptions | public function setModelForOptions($modelForOptions, $display = null)
{
if ($display) {
$this->display = $display;
}
if (is_string($modelForOptions)) {
$modelForOptions = app($modelForOptions);
}
if (! ($modelForOptions instanceof Model)) {
... | php | public function setModelForOptions($modelForOptions, $display = null)
{
if ($display) {
$this->display = $display;
}
if (is_string($modelForOptions)) {
$modelForOptions = app($modelForOptions);
}
if (! ($modelForOptions instanceof Model)) {
... | [
"public",
"function",
"setModelForOptions",
"(",
"$",
"modelForOptions",
",",
"$",
"display",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"display",
")",
"{",
"$",
"this",
"->",
"display",
"=",
"$",
"display",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"... | @param @param string|Model $modelForOptions
@return $this
@throws SelectException | [
"@param",
"@param",
"string|Model",
"$modelForOptions"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/SelectOptionsFromModel.php#L62-L79 |
LaravelRUS/SleepingOwlAdmin | src/Traits/SelectOptionsFromModel.php | SelectOptionsFromModel.setFetchColumns | public function setFetchColumns($columns)
{
if (! is_array($columns)) {
$columns = func_get_args();
}
$this->fetchColumns = $columns;
return $this;
} | php | public function setFetchColumns($columns)
{
if (! is_array($columns)) {
$columns = func_get_args();
}
$this->fetchColumns = $columns;
return $this;
} | [
"public",
"function",
"setFetchColumns",
"(",
"$",
"columns",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"columns",
")",
")",
"{",
"$",
"columns",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"fetchColumns",
"=",
"$",
"columns",
... | Set Only fetch columns.
If use {@link Select#setModelForOptions($model)}, on fetch
data from the $model table, only specified columns has be
feched.
Examples: <code>setFetchColumns('title')</code> or
<code>setFetchColumns(['title'])</code> or
<code>setFetchColumns('title', 'position')</code> or
<code>setFetchColumns(... | [
"Set",
"Only",
"fetch",
"columns",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/SelectOptionsFromModel.php#L129-L138 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Columns.php | Columns.set | public function set($columns)
{
if (! is_array($columns)) {
$columns = func_get_args();
}
foreach ($columns as $column) {
$this->push($column);
}
return $this->getDisplay();
} | php | public function set($columns)
{
if (! is_array($columns)) {
$columns = func_get_args();
}
foreach ($columns as $column) {
$this->push($column);
}
return $this->getDisplay();
} | [
"public",
"function",
"set",
"(",
"$",
"columns",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"columns",
")",
")",
"{",
"$",
"columns",
"=",
"func_get_args",
"(",
")",
";",
"}",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"... | @param $columns
@return \SleepingOwl\Admin\Contracts\Display\DisplayInterface | [
"@param",
"$columns"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Columns.php#L117-L128 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Columns.php | Columns.render | public function render()
{
$params = $this->toArray();
$params['collection'] = $this->getDisplay()->getCollection();
$params['pagination'] = null;
if ($params['collection'] instanceof \Illuminate\Contracts\Pagination\Paginator) {
if (class_exists('Illuminate\Pagination\B... | php | public function render()
{
$params = $this->toArray();
$params['collection'] = $this->getDisplay()->getCollection();
$params['pagination'] = null;
if ($params['collection'] instanceof \Illuminate\Contracts\Pagination\Paginator) {
if (class_exists('Illuminate\Pagination\B... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"$",
"params",
"[",
"'collection'",
"]",
"=",
"$",
"this",
"->",
"getDisplay",
"(",
")",
"->",
"getCollection",
"(",
")",
";",
"$",
"par... | Get the evaluated contents of the object.
@return string | [
"Get",
"the",
"evaluated",
"contents",
"of",
"the",
"object",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Columns.php#L181-L196 |
LaravelRUS/SleepingOwlAdmin | src/AliasBinder.php | AliasBinder.registerRoutes | public static function registerRoutes(\Illuminate\Contracts\Routing\Registrar $router)
{
foreach (self::$routes as $i => $route) {
call_user_func($route, $router);
unset(self::$routes[$i]);
}
} | php | public static function registerRoutes(\Illuminate\Contracts\Routing\Registrar $router)
{
foreach (self::$routes as $i => $route) {
call_user_func($route, $router);
unset(self::$routes[$i]);
}
} | [
"public",
"static",
"function",
"registerRoutes",
"(",
"\\",
"Illuminate",
"\\",
"Contracts",
"\\",
"Routing",
"\\",
"Registrar",
"$",
"router",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"routes",
"as",
"$",
"i",
"=>",
"$",
"route",
")",
"{",
"call_us... | @param \Illuminate\Contracts\Routing\Registrar $router
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Contracts",
"\\",
"Routing",
"\\",
"Registrar",
"$router"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/AliasBinder.php#L20-L26 |
LaravelRUS/SleepingOwlAdmin | src/AliasBinder.php | AliasBinder.makeClass | public function makeClass($alias, array $arguments)
{
$reflection = new \ReflectionClass($this->getAlias($alias));
return $reflection->newInstanceArgs($arguments);
} | php | public function makeClass($alias, array $arguments)
{
$reflection = new \ReflectionClass($this->getAlias($alias));
return $reflection->newInstanceArgs($arguments);
} | [
"public",
"function",
"makeClass",
"(",
"$",
"alias",
",",
"array",
"$",
"arguments",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"getAlias",
"(",
"$",
"alias",
")",
")",
";",
"return",
"$",
"reflection",
"... | @param string $alias
@param array $arguments
@return object | [
"@param",
"string",
"$alias",
"@param",
"array",
"$arguments"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/AliasBinder.php#L132-L137 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.composeName | private function composeName(array $parts)
{
$name = array_shift($parts);
while (! empty($parts)) {
$part = array_shift($parts);
$name .= "[$part]";
}
return $name;
} | php | private function composeName(array $parts)
{
$name = array_shift($parts);
while (! empty($parts)) {
$part = array_shift($parts);
$name .= "[$part]";
}
return $name;
} | [
"private",
"function",
"composeName",
"(",
"array",
"$",
"parts",
")",
"{",
"$",
"name",
"=",
"array_shift",
"(",
"$",
"parts",
")",
";",
"while",
"(",
"!",
"empty",
"(",
"$",
"parts",
")",
")",
"{",
"$",
"part",
"=",
"array_shift",
"(",
"$",
"part... | Compose html name from array like this: 'first[second][third]'.
@param array $parts
@return string | [
"Compose",
"html",
"name",
"from",
"array",
"like",
"this",
":",
"first",
"[",
"second",
"]",
"[",
"third",
"]",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L95-L105 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.unique | public function unique($message = null)
{
$this->addValidationRule('_unique');
if (! is_null($message)) {
$this->addValidationMessage('unique', $message);
}
return $this;
} | php | public function unique($message = null)
{
$this->addValidationRule('_unique');
if (! is_null($message)) {
$this->addValidationMessage('unique', $message);
}
return $this;
} | [
"public",
"function",
"unique",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addValidationRule",
"(",
"'_unique'",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"message",
")",
")",
"{",
"$",
"this",
"->",
"addValidationMessage",
"(... | @param string|null $message
@return $this | [
"@param",
"string|null",
"$message"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L248-L257 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.getValidationRules | public function getValidationRules()
{
$rules = parent::getValidationRules();
foreach ($rules as &$rule) {
if ($rule !== '_unique') {
continue;
}
$model = $this->resolvePath();
$table = $model->getTable();
$rule = 'unique... | php | public function getValidationRules()
{
$rules = parent::getValidationRules();
foreach ($rules as &$rule) {
if ($rule !== '_unique') {
continue;
}
$model = $this->resolvePath();
$table = $model->getTable();
$rule = 'unique... | [
"public",
"function",
"getValidationRules",
"(",
")",
"{",
"$",
"rules",
"=",
"parent",
"::",
"getValidationRules",
"(",
")",
";",
"foreach",
"(",
"$",
"rules",
"as",
"&",
"$",
"rule",
")",
"{",
"if",
"(",
"$",
"rule",
"!==",
"'_unique'",
")",
"{",
"... | If FormElement has `_unique` rule, it will get all appropriate
validation rules based on underlying model.
@return array | [
"If",
"FormElement",
"has",
"_unique",
"rule",
"it",
"will",
"get",
"all",
"appropriate",
"validation",
"rules",
"based",
"on",
"underlying",
"model",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L288-L308 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.resolvePath | public function resolvePath()
{
$model = $this->getModel();
$relations = explode('.', $this->getPath());
$count = count($relations);
if ($count === 1) {
return $model;
}
foreach ($relations as $relation) {
if ($count === 1) {
... | php | public function resolvePath()
{
$model = $this->getModel();
$relations = explode('.', $this->getPath());
$count = count($relations);
if ($count === 1) {
return $model;
}
foreach ($relations as $relation) {
if ($count === 1) {
... | [
"public",
"function",
"resolvePath",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"relations",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"getPath",
"(",
")",
")",
";",
"$",
"count",
"=",
"count",
... | Get model related to form element.
@return mixed | [
"Get",
"model",
"related",
"to",
"form",
"element",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L315-L351 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.getValueFromRequest | public function getValueFromRequest(\Illuminate\Http\Request $request)
{
if ($request->hasSession() && ! is_null($value = $request->old($this->getPath()))) {
return $value;
}
return $request->input($this->getPath());
} | php | public function getValueFromRequest(\Illuminate\Http\Request $request)
{
if ($request->hasSession() && ! is_null($value = $request->old($this->getPath()))) {
return $value;
}
return $request->input($this->getPath());
} | [
"public",
"function",
"getValueFromRequest",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"hasSession",
"(",
")",
"&&",
"!",
"is_null",
"(",
"$",
"value",
"=",
"$",
"request",
"->",
... | @param \Illuminate\Http\Request $request
@return array|string | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L358-L365 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.save | public function save(\Illuminate\Http\Request $request)
{
$this->setModelAttribute($this->getValueFromRequest($request));
} | php | public function save(\Illuminate\Http\Request $request)
{
$this->setModelAttribute($this->getValueFromRequest($request));
} | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"setModelAttribute",
"(",
"$",
"this",
"->",
"getValueFromRequest",
"(",
"$",
"request",
")",
")",
";",
"}"
] | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L447-L450 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.setModelAttribute | public function setModelAttribute($value)
{
$model = $this->getModelByPath($this->getPath());
if ($this->isValueSkipped()) {
return;
}
$model->setAttribute($this->getModelAttributeKey(), $this->prepareValue($value));
} | php | public function setModelAttribute($value)
{
$model = $this->getModelByPath($this->getPath());
if ($this->isValueSkipped()) {
return;
}
$model->setAttribute($this->getModelAttributeKey(), $this->prepareValue($value));
} | [
"public",
"function",
"setModelAttribute",
"(",
"$",
"value",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelByPath",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isValueSkipped",
"(",
")",
")",
"{",... | @param mixed $value
@return void | [
"@param",
"mixed",
"$value"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L457-L466 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.getModelByPath | protected function getModelByPath($path)
{
$model = $this->getModel();
$relations = explode('.', $path);
$count = count($relations);
$i = 1;
if ($count > 1) {
$i++;
$previousModel = $model;
/* @var Model $model */
foreach ($r... | php | protected function getModelByPath($path)
{
$model = $this->getModel();
$relations = explode('.', $path);
$count = count($relations);
$i = 1;
if ($count > 1) {
$i++;
$previousModel = $model;
/* @var Model $model */
foreach ($r... | [
"protected",
"function",
"getModelByPath",
"(",
"$",
"path",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"relations",
"=",
"explode",
"(",
"'.'",
",",
"$",
"path",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
... | @param string $path
@return Model|null | [
"@param",
"string",
"$path"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L473-L520 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/NamedFormElement.php | NamedFormElement.prepareValue | public function prepareValue($value)
{
if ($this->hasMutator()) {
$value = call_user_func($this->mutator, $value);
}
return $value;
} | php | public function prepareValue($value)
{
if ($this->hasMutator()) {
$value = call_user_func($this->mutator, $value);
}
return $value;
} | [
"public",
"function",
"prepareValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasMutator",
"(",
")",
")",
"{",
"$",
"value",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"mutator",
",",
"$",
"value",
")",
";",
"}",
"return",
"... | @param mixed $value
@return mixed | [
"@param",
"mixed",
"$value"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/NamedFormElement.php#L557-L564 |
LaravelRUS/SleepingOwlAdmin | src/Console/Installation/CreateBootstrapFile.php | CreateBootstrapFile.install | public function install()
{
$file = $this->getFilePath();
$contents = $this->command->files()->get(SLEEPINGOWL_STUB_PATH.'/bootstrap.stub');
$this->command->files()->put($file, $contents);
$filePath = str_replace(base_path(), '', $file);
$this->command->line("<info>Bootstrap... | php | public function install()
{
$file = $this->getFilePath();
$contents = $this->command->files()->get(SLEEPINGOWL_STUB_PATH.'/bootstrap.stub');
$this->command->files()->put($file, $contents);
$filePath = str_replace(base_path(), '', $file);
$this->command->line("<info>Bootstrap... | [
"public",
"function",
"install",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFilePath",
"(",
")",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"command",
"->",
"files",
"(",
")",
"->",
"get",
"(",
"SLEEPINGOWL_STUB_PATH",
".",
"'/bootstrap... | Install the components.
@return void | [
"Install",
"the",
"components",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Console/Installation/CreateBootstrapFile.php#L17-L25 |
LaravelRUS/SleepingOwlAdmin | src/Form/Buttons/Cancel.php | Cancel.initialize | public function initialize()
{
parent::initialize();
$this->setUrl($this->getModelConfiguration()->getCancelUrl());
$this->setHtmlAttributes($this->getHtmlAttributes() + [
'class' => 'btn btn-warning',
]);
} | php | public function initialize()
{
parent::initialize();
$this->setUrl($this->getModelConfiguration()->getCancelUrl());
$this->setHtmlAttributes($this->getHtmlAttributes() + [
'class' => 'btn btn-warning',
]);
} | [
"public",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"$",
"this",
"->",
"setUrl",
"(",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"getCancelUrl",
"(",
")",
")",
";",
"$",
"this",
"->",
"setHtm... | Init Cancel Button. | [
"Init",
"Cancel",
"Button",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Buttons/Cancel.php#L22-L30 |
LaravelRUS/SleepingOwlAdmin | src/Model/SectionModelConfiguration.php | SectionModelConfiguration.fireEdit | public function fireEdit($id, $payload = [])
{
if (! method_exists($this, 'onEdit')) {
return;
}
$payload = array_merge(['id' => $id], ['payload' => $payload]);
$form = $this->app->call([$this, 'onEdit'], $payload);
if ($form instanceof DisplayInterface) {
... | php | public function fireEdit($id, $payload = [])
{
if (! method_exists($this, 'onEdit')) {
return;
}
$payload = array_merge(['id' => $id], ['payload' => $payload]);
$form = $this->app->call([$this, 'onEdit'], $payload);
if ($form instanceof DisplayInterface) {
... | [
"public",
"function",
"fireEdit",
"(",
"$",
"id",
",",
"$",
"payload",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"'onEdit'",
")",
")",
"{",
"return",
";",
"}",
"$",
"payload",
"=",
"array_merge",
"(",
"[",
"... | @param int $id
@param mixed $payload
@return mixed|void | [
"@param",
"int",
"$id",
"@param",
"mixed",
"$payload"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/SectionModelConfiguration.php#L119-L143 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Assets.php | Assets.addJs | public function addJs($handle = false, $src = null, $dependency = null, $footer = true)
{
return parent::addJs($handle, $src, $dependency, $footer);
} | php | public function addJs($handle = false, $src = null, $dependency = null, $footer = true)
{
return parent::addJs($handle, $src, $dependency, $footer);
} | [
"public",
"function",
"addJs",
"(",
"$",
"handle",
"=",
"false",
",",
"$",
"src",
"=",
"null",
",",
"$",
"dependency",
"=",
"null",
",",
"$",
"footer",
"=",
"true",
")",
"{",
"return",
"parent",
"::",
"addJs",
"(",
"$",
"handle",
",",
"$",
"src",
... | Gets or sets javascript assets.
@param bool|string $handle
@param string $src Asset source
@param array|string $dependency Dependencies
@param bool $footer Whether to show in header or footer
@return AssetElementInterface Setting returns asset array, getting returns asset HTML | [
"Gets",
"or",
"sets",
"javascript",
"assets",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Assets.php#L29-L32 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Assets.php | Assets.insertBefore | protected function insertBefore($key, &$array, $new_key, $new_value)
{
if (array_key_exists($key, $array)) {
$new = [];
foreach ($array as $k => $value) {
if ($k === $key) {
$new[$new_key] = $new_value;
}
$new[$k] = ... | php | protected function insertBefore($key, &$array, $new_key, $new_value)
{
if (array_key_exists($key, $array)) {
$new = [];
foreach ($array as $k => $value) {
if ($k === $key) {
$new[$new_key] = $new_value;
}
$new[$k] = ... | [
"protected",
"function",
"insertBefore",
"(",
"$",
"key",
",",
"&",
"$",
"array",
",",
"$",
"new_key",
",",
"$",
"new_value",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"array",
")",
")",
"{",
"$",
"new",
"=",
"[",
"]",
"... | Inserts a new key/value before the key in the array.
@param $key
The key to insert before.
@param $array
An array to insert in to.
@param $new_key
The key to insert.
@param $new_value
An value to insert.
@return array|bool The new array if the key exists, FALSE otherwise.
@see array_insert_after() | [
"Inserts",
"a",
"new",
"key",
"/",
"value",
"before",
"the",
"key",
"in",
"the",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Assets.php#L105-L120 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Assets.php | Assets.insertAfter | protected function insertAfter($key, Collection &$array, $new_key, $new_value)
{
if ($array->has($key)) {
$new = [];
foreach ($array as $k => $value) {
$new[$k] = $value;
if ($k === $key) {
$new[$new_key] = $new_value;
... | php | protected function insertAfter($key, Collection &$array, $new_key, $new_value)
{
if ($array->has($key)) {
$new = [];
foreach ($array as $k => $value) {
$new[$k] = $value;
if ($k === $key) {
$new[$new_key] = $new_value;
... | [
"protected",
"function",
"insertAfter",
"(",
"$",
"key",
",",
"Collection",
"&",
"$",
"array",
",",
"$",
"new_key",
",",
"$",
"new_value",
")",
"{",
"if",
"(",
"$",
"array",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
"new",
"=",
"[",
"]",
... | Inserts a new key/value after the key in the array.
@param $key
The key to insert after.
@param $array
An array to insert in to.
@param $new_key
The key to insert.
@param $new_value
An value to insert.
@return Collection|bool The new array if the key exists, FALSE otherwise. | [
"Inserts",
"a",
"new",
"key",
"/",
"value",
"after",
"the",
"key",
"in",
"the",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Assets.php#L135-L150 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfiguration.php | ModelConfiguration.isEditable | public function isEditable(Model $model)
{
if (! is_callable($this->getEdit())) {
return false;
}
return $this->editable && parent::isEditable($model);
} | php | public function isEditable(Model $model)
{
if (! is_callable($this->getEdit())) {
return false;
}
return $this->editable && parent::isEditable($model);
} | [
"public",
"function",
"isEditable",
"(",
"Model",
"$",
"model",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"this",
"->",
"getEdit",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"editable",
"&&",
"parent",... | @param Model $model
@return bool | [
"@param",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfiguration.php#L267-L274 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfiguration.php | ModelConfiguration.onCreateAndEdit | public function onCreateAndEdit(Closure $callback = null)
{
$this->onCreate($callback);
$this->onEdit($callback);
return $this;
} | php | public function onCreateAndEdit(Closure $callback = null)
{
$this->onCreate($callback);
$this->onEdit($callback);
return $this;
} | [
"public",
"function",
"onCreateAndEdit",
"(",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"onCreate",
"(",
"$",
"callback",
")",
";",
"$",
"this",
"->",
"onEdit",
"(",
"$",
"callback",
")",
";",
"return",
"$",
"this",
";",
"... | @param Closure|null $callback
@return $this | [
"@param",
"Closure|null",
"$callback"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfiguration.php#L519-L525 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfiguration.php | ModelConfiguration.fireDelete | public function fireDelete($id)
{
if (is_callable($this->getDelete())) {
return $this->app->call($this->getDelete(), [$id]);
}
} | php | public function fireDelete($id)
{
if (is_callable($this->getDelete())) {
return $this->app->call($this->getDelete(), [$id]);
}
} | [
"public",
"function",
"fireDelete",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"getDelete",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"->",
"call",
"(",
"$",
"this",
"->",
"getDelete",
"(",
")",
... | @param int|string $id
@return mixed | [
"@param",
"int|string",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfiguration.php#L552-L557 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfiguration.php | ModelConfiguration.fireDestroy | public function fireDestroy($id)
{
if (is_callable($this->getDestroy())) {
return $this->app->call($this->getDestroy(), [$id]);
}
} | php | public function fireDestroy($id)
{
if (is_callable($this->getDestroy())) {
return $this->app->call($this->getDestroy(), [$id]);
}
} | [
"public",
"function",
"fireDestroy",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"getDestroy",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"->",
"call",
"(",
"$",
"this",
"->",
"getDestroy",
"(",
")"... | @param int|string $id
@return mixed | [
"@param",
"int|string",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfiguration.php#L584-L589 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfiguration.php | ModelConfiguration.fireRestore | public function fireRestore($id)
{
if (is_callable($this->getRestore())) {
return $this->app->call($this->getRestore(), [$id]);
}
} | php | public function fireRestore($id)
{
if (is_callable($this->getRestore())) {
return $this->app->call($this->getRestore(), [$id]);
}
} | [
"public",
"function",
"fireRestore",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"getRestore",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"->",
"call",
"(",
"$",
"this",
"->",
"getRestore",
"(",
")"... | @param int|string $id
@return bool|mixed | [
"@param",
"int|string",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfiguration.php#L616-L621 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/BaseRepository.php | BaseRepository.setModel | public function setModel(Model $model)
{
$this->model = $model;
$this->class = get_class($model);
return $this;
} | php | public function setModel(Model $model)
{
$this->model = $model;
$this->class = get_class($model);
return $this;
} | [
"public",
"function",
"setModel",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"class",
"=",
"get_class",
"(",
"$",
"model",
")",
";",
"return",
"$",
"this",
";",
"}"
] | @param Model $model
@return $this | [
"@param",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/BaseRepository.php#L70-L76 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/BaseRepository.php | BaseRepository.with | public function with($with)
{
if (! is_array($with)) {
$with = func_get_args();
}
$this->with = $with;
return $this;
} | php | public function with($with)
{
if (! is_array($with)) {
$with = func_get_args();
}
$this->with = $with;
return $this;
} | [
"public",
"function",
"with",
"(",
"$",
"with",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"with",
")",
")",
"{",
"$",
"with",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"with",
"=",
"$",
"with",
";",
"return",
"$",
"this... | @param string[] $with
@return $this | [
"@param",
"string",
"[]",
"$with"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/BaseRepository.php#L91-L100 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/BaseRepository.php | BaseRepository.find | public function find($id)
{
$query = $this->getQuery();
if ($this->isRestorable()) {
$query->withTrashed();
}
return $query->find($id);
} | php | public function find($id)
{
$query = $this->getQuery();
if ($this->isRestorable()) {
$query->withTrashed();
}
return $query->find($id);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isRestorable",
"(",
")",
")",
"{",
"$",
"query",
"->",
"withTrashed",
"(",
")",
";",
"}",
"r... | Find model instance by id.
@param int $id
@return mixed | [
"Find",
"model",
"instance",
"by",
"id",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/BaseRepository.php#L122-L130 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/BaseRepository.php | BaseRepository.findMany | public function findMany(array $ids)
{
$query = $this->getQuery();
if ($this->isRestorable()) {
$query->withTrashed();
}
return $query->whereIn($this->getModel()->getKeyName(), $ids)->get();
} | php | public function findMany(array $ids)
{
$query = $this->getQuery();
if ($this->isRestorable()) {
$query->withTrashed();
}
return $query->whereIn($this->getModel()->getKeyName(), $ids)->get();
} | [
"public",
"function",
"findMany",
"(",
"array",
"$",
"ids",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isRestorable",
"(",
")",
")",
"{",
"$",
"query",
"->",
"withTrashed",
"(",
")",
... | Find model instances by ids.
@param int[] $ids
@return \Illuminate\Support\Collection | [
"Find",
"model",
"instances",
"by",
"ids",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/BaseRepository.php#L151-L159 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTable.php | DisplayTable.initialize | public function initialize()
{
parent::initialize();
if ($this->getModelConfiguration()->isRestorableModel()) {
$this->setApply(function (Builder $q) {
return $q->withTrashed();
});
}
$this->setHtmlAttribute('class', 'table table-striped');
... | php | public function initialize()
{
parent::initialize();
if ($this->getModelConfiguration()->isRestorableModel()) {
$this->setApply(function (Builder $q) {
return $q->withTrashed();
});
}
$this->setHtmlAttribute('class', 'table table-striped');
... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"isRestorableModel",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setApply",
"(",
"function"... | Initialize display. | [
"Initialize",
"display",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTable.php#L74-L85 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTable.php | DisplayTable.paginate | public function paginate($perPage = 25, $pageName = 'page')
{
$this->paginate = (int) $perPage;
$this->pageName = $pageName;
return $this;
} | php | public function paginate($perPage = 25, $pageName = 'page')
{
$this->paginate = (int) $perPage;
$this->pageName = $pageName;
return $this;
} | [
"public",
"function",
"paginate",
"(",
"$",
"perPage",
"=",
"25",
",",
"$",
"pageName",
"=",
"'page'",
")",
"{",
"$",
"this",
"->",
"paginate",
"=",
"(",
"int",
")",
"$",
"perPage",
";",
"$",
"this",
"->",
"pageName",
"=",
"$",
"pageName",
";",
"re... | @param int $perPage
@param string $pageName
@return $this | [
"@param",
"int",
"$perPage",
"@param",
"string",
"$pageName"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTable.php#L150-L156 |
LaravelRUS/SleepingOwlAdmin | src/Console/Generator.php | Generator.getAliasesByExtendsNamespace | protected function getAliasesByExtendsNamespace()
{
$aliases = $this->getValidAliases();
$aliases = $aliases->filter(function (Alias $item) {
return ! collect([
'MessageStack',
'AdminSection',
'AdminTemplate',
'AdminNavigat... | php | protected function getAliasesByExtendsNamespace()
{
$aliases = $this->getValidAliases();
$aliases = $aliases->filter(function (Alias $item) {
return ! collect([
'MessageStack',
'AdminSection',
'AdminTemplate',
'AdminNavigat... | [
"protected",
"function",
"getAliasesByExtendsNamespace",
"(",
")",
"{",
"$",
"aliases",
"=",
"$",
"this",
"->",
"getValidAliases",
"(",
")",
";",
"$",
"aliases",
"=",
"$",
"aliases",
"->",
"filter",
"(",
"function",
"(",
"Alias",
"$",
"item",
")",
"{",
"... | Regroup aliases by namespace of extended classes.
@return Collection | [
"Regroup",
"aliases",
"by",
"namespace",
"of",
"extended",
"classes",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Console/Generator.php#L23-L46 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.setActive | public function setActive($active = true)
{
$this->active = (bool) $active;
if ($active) {
$this->setHtmlAttribute('class', 'active');
}
return $this;
} | php | public function setActive($active = true)
{
$this->active = (bool) $active;
if ($active) {
$this->setHtmlAttribute('class', 'active');
}
return $this;
} | [
"public",
"function",
"setActive",
"(",
"$",
"active",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"active",
"=",
"(",
"bool",
")",
"$",
"active",
";",
"if",
"(",
"$",
"active",
")",
"{",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'class'",
",",
"'... | @param bool $active
@return $this | [
"@param",
"bool",
"$active"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L154-L163 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.setAction | public function setAction($action)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->setAction($action);
}
return $this;
} | php | public function setAction($action)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->setAction($action);
}
return $this;
} | [
"public",
"function",
"setAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
"instanceof",
"FormInterface",
")",
"{",
"$",
"content",
"->",
"setAction",
"(",
"$",
"action",
")",
... | @param string $action
@return $this | [
"@param",
"string",
"$action"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L309-L316 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.setId | public function setId($id)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->setId($id);
}
return $this;
} | php | public function setId($id)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->setId($id);
}
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
"instanceof",
"FormInterface",
")",
"{",
"$",
"content",
"->",
"setId",
"(",
"$",
"id",
")",
";",
"}",
"... | @param int $id
@return $this | [
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L323-L330 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.validateForm | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->validateForm($request, $model);
}
} | php | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null)
{
if (($content = $this->getContent()) instanceof FormInterface) {
$content->validateForm($request, $model);
}
} | [
"public",
"function",
"validateForm",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
",",
"ModelConfigurationInterface",
"$",
"model",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"("... | @param \Illuminate\Http\Request $request
@param ModelConfigurationInterface $model
@throws ValidationException | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request",
"@param",
"ModelConfigurationInterface",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L338-L343 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.setModel | public function setModel(Model $model)
{
if (($content = $this->getContent()) instanceof WithModelInterface) {
$content->setModel($model);
}
return $this;
} | php | public function setModel(Model $model)
{
if (($content = $this->getContent()) instanceof WithModelInterface) {
$content->setModel($model);
}
return $this;
} | [
"public",
"function",
"setModel",
"(",
"Model",
"$",
"model",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
"instanceof",
"WithModelInterface",
")",
"{",
"$",
"content",
"->",
"setModel",
"(",
"$",
"mode... | Set currently rendered instance.
@param Model $model
@return $this | [
"Set",
"currently",
"rendered",
"instance",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L367-L374 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.save | public function save(\Illuminate\Http\Request $request)
{
if (($content = $this->getContent()) instanceof FormElementInterface) {
$content->save($request);
}
} | php | public function save(\Illuminate\Http\Request $request)
{
if (($content = $this->getContent()) instanceof FormElementInterface) {
$content->save($request);
}
} | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
"instanceof",
"FormElementInterface",
")",
"{",
"$",
"c... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L428-L433 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTab.php | DisplayTab.setElements | public function setElements(array $elements)
{
if (($content = $this->getContent()) instanceof ElementsInterface) {
$content->setElements($elements);
}
return $this;
} | php | public function setElements(array $elements)
{
if (($content = $this->getContent()) instanceof ElementsInterface) {
$content->setElements($elements);
}
return $this;
} | [
"public",
"function",
"setElements",
"(",
"array",
"$",
"elements",
")",
"{",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
"instanceof",
"ElementsInterface",
")",
"{",
"$",
"content",
"->",
"setElements",
"(",
"$",... | @param array $elements
@return $this | [
"@param",
"array",
"$elements"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTab.php#L510-L517 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Images.php | Images.save | public function save(\Illuminate\Http\Request $request)
{
$name = $this->getName();
$value = $request->input($name, '');
if (! empty($value)) {
$value = explode(',', $value);
} else {
$value = [];
}
$request->merge([$name => $value]);
... | php | public function save(\Illuminate\Http\Request $request)
{
$name = $this->getName();
$value = $request->input($name, '');
if (! empty($value)) {
$value = explode(',', $value);
} else {
$value = [];
}
$request->merge([$name => $value]);
... | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"value",
"=",
"$",
"request",
"->",
"input",
"(",
"$",
"name",
",",
... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Images.php#L63-L77 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/ColumnFilters.php | ColumnFilters.set | public function set($columnFilters)
{
if (! is_array($columnFilters)) {
$columnFilters = func_get_args();
}
$this->columnFilters = [];
foreach ($columnFilters as $filter) {
$this->push($filter);
}
return $this;
} | php | public function set($columnFilters)
{
if (! is_array($columnFilters)) {
$columnFilters = func_get_args();
}
$this->columnFilters = [];
foreach ($columnFilters as $filter) {
$this->push($filter);
}
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"columnFilters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"columnFilters",
")",
")",
"{",
"$",
"columnFilters",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"columnFilters",
"=",
"[",
"]",
... | @param array|ColumnFilterInterface $columnFilters
@return $this | [
"@param",
"array|ColumnFilterInterface",
"$columnFilters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/ColumnFilters.php#L36-L49 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/ColumnFilters.php | ColumnFilters.toArray | public function toArray()
{
$this->setHtmlAttribute('data-display', class_basename($this->getDisplay()));
return [
'filters' => $this->columnFilters,
'attributes' => $this->htmlAttributesToString(),
'tag' => $this->getPlacement() == 'table.header' ? 'thead' : 'tf... | php | public function toArray()
{
$this->setHtmlAttribute('data-display', class_basename($this->getDisplay()));
return [
'filters' => $this->columnFilters,
'attributes' => $this->htmlAttributesToString(),
'tag' => $this->getPlacement() == 'table.header' ? 'thead' : 'tf... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'data-display'",
",",
"class_basename",
"(",
"$",
"this",
"->",
"getDisplay",
"(",
")",
")",
")",
";",
"return",
"[",
"'filters'",
"=>",
"$",
"this",
"->",
"colu... | Get the instance as an array.
@return array | [
"Get",
"the",
"instance",
"as",
"an",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/ColumnFilters.php#L144-L153 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/ColumnFilters.php | ColumnFilters.initialize | public function initialize()
{
if (empty($this->columnFilters)) {
return;
}
$this->validNumberOfFilters();
foreach ($this->all() as $filter) {
if ($filter instanceof Initializable) {
$filter->initialize();
}
}
$th... | php | public function initialize()
{
if (empty($this->columnFilters)) {
return;
}
$this->validNumberOfFilters();
foreach ($this->all() as $filter) {
if ($filter instanceof Initializable) {
$filter->initialize();
}
}
$th... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"columnFilters",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"validNumberOfFilters",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"all",
"("... | Initialize class. | [
"Initialize",
"class",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/ColumnFilters.php#L158-L184 |
LaravelRUS/SleepingOwlAdmin | src/Display/Tree/NestedsetType.php | NestedsetType.reorder | public function reorder(array $data)
{
$left = 1;
foreach ($data as $root) {
$left = $this->recursiveReorder($root, null, $left);
}
} | php | public function reorder(array $data)
{
$left = 1;
foreach ($data as $root) {
$left = $this->recursiveReorder($root, null, $left);
}
} | [
"public",
"function",
"reorder",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"left",
"=",
"1",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"root",
")",
"{",
"$",
"left",
"=",
"$",
"this",
"->",
"recursiveReorder",
"(",
"$",
"root",
",",
"null",
",... | Reorder tree by $data value.
@param $data | [
"Reorder",
"tree",
"by",
"$data",
"value",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Tree/NestedsetType.php#L37-L43 |
LaravelRUS/SleepingOwlAdmin | src/Display/Tree/NestedsetType.php | NestedsetType.recursiveReorder | protected function recursiveReorder($root, $parentId, $left)
{
$right = $left + 1;
$children = array_get($root, 'children', []);
foreach ($children as $child) {
$right = $this->recursiveReorder($child, $root['id'], $right);
}
$this->move($root['id'], $parentId, $l... | php | protected function recursiveReorder($root, $parentId, $left)
{
$right = $left + 1;
$children = array_get($root, 'children', []);
foreach ($children as $child) {
$right = $this->recursiveReorder($child, $root['id'], $right);
}
$this->move($root['id'], $parentId, $l... | [
"protected",
"function",
"recursiveReorder",
"(",
"$",
"root",
",",
"$",
"parentId",
",",
"$",
"left",
")",
"{",
"$",
"right",
"=",
"$",
"left",
"+",
"1",
";",
"$",
"children",
"=",
"array_get",
"(",
"$",
"root",
",",
"'children'",
",",
"[",
"]",
"... | Recursive reorder nested-set tree type.
@param $root
@param $parentId
@param $left
@return mixed | [
"Recursive",
"reorder",
"nested",
"-",
"set",
"tree",
"type",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Tree/NestedsetType.php#L81-L92 |
LaravelRUS/SleepingOwlAdmin | src/Display/Tree/NestedsetType.php | NestedsetType.move | protected function move($id, $parentId, $left, $right)
{
$instance = $this->repository->find($id);
$attributes = $instance->getAttributes();
$attributes[$this->getLeftColumn($instance)] = $left;
$attributes[$this->getRightColumn($instance)] = $right;
$attributes[$this->getPa... | php | protected function move($id, $parentId, $left, $right)
{
$instance = $this->repository->find($id);
$attributes = $instance->getAttributes();
$attributes[$this->getLeftColumn($instance)] = $left;
$attributes[$this->getRightColumn($instance)] = $right;
$attributes[$this->getPa... | [
"protected",
"function",
"move",
"(",
"$",
"id",
",",
"$",
"parentId",
",",
"$",
"left",
",",
"$",
"right",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"repository",
"->",
"find",
"(",
"$",
"id",
")",
";",
"$",
"attributes",
"=",
"$",
"ins... | Move tree node in nested-set tree type.
@param $id
@param $parentId
@param $left
@param $right | [
"Move",
"tree",
"node",
"in",
"nested",
"-",
"set",
"tree",
"type",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Tree/NestedsetType.php#L102-L113 |
LaravelRUS/SleepingOwlAdmin | src/Admin.php | Admin.register | public function register(ModelConfigurationInterface $model)
{
$this->setModel($model->getClass(), $model);
if ($model instanceof Initializable) {
$model->initialize();
}
return $this;
} | php | public function register(ModelConfigurationInterface $model)
{
$this->setModel($model->getClass(), $model);
if ($model instanceof Initializable) {
$model->initialize();
}
return $this;
} | [
"public",
"function",
"register",
"(",
"ModelConfigurationInterface",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"setModel",
"(",
"$",
"model",
"->",
"getClass",
"(",
")",
",",
"$",
"model",
")",
";",
"if",
"(",
"$",
"model",
"instanceof",
"Initializable",... | @param ModelConfigurationInterface $model
@return $this | [
"@param",
"ModelConfigurationInterface",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Admin.php#L109-L118 |
LaravelRUS/SleepingOwlAdmin | src/Admin.php | Admin.registerSections | public function registerSections(array $sections)
{
foreach ($sections as $model => $section) {
if (class_exists($section)) {
$this->register(new $section($this->app, $model));
} else {
$this->missedSections[$model] = $section;
}
}
... | php | public function registerSections(array $sections)
{
foreach ($sections as $model => $section) {
if (class_exists($section)) {
$this->register(new $section($this->app, $model));
} else {
$this->missedSections[$model] = $section;
}
}
... | [
"public",
"function",
"registerSections",
"(",
"array",
"$",
"sections",
")",
"{",
"foreach",
"(",
"$",
"sections",
"as",
"$",
"model",
"=>",
"$",
"section",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"section",
")",
")",
"{",
"$",
"this",
"->",
... | @param array $sections
@return $this | [
"@param",
"array",
"$sections"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Admin.php#L125-L136 |
LaravelRUS/SleepingOwlAdmin | src/Admin.php | Admin.view | public function view($content, $title = null)
{
return $this->app[AdminController::class]->renderContent($content, $title);
} | php | public function view($content, $title = null)
{
return $this->app[AdminController::class]->renderContent($content, $title);
} | [
"public",
"function",
"view",
"(",
"$",
"content",
",",
"$",
"title",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"[",
"AdminController",
"::",
"class",
"]",
"->",
"renderContent",
"(",
"$",
"content",
",",
"$",
"title",
")",
";",
"}"
... | @param string|Renderable $content
@param string|null $title
@return \Illuminate\View\View|\Illuminate\Contracts\View\Factory | [
"@param",
"string|Renderable",
"$content",
"@param",
"string|null",
"$title"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Admin.php#L236-L239 |
LaravelRUS/SleepingOwlAdmin | src/Admin.php | Admin.registerBaseServiceProviders | protected function registerBaseServiceProviders()
{
$providers = [
AliasesServiceProvider::class,
\Collective\Html\HtmlServiceProvider::class,
BreadcrumbsServiceProvider::class,
AdminServiceProvider::class,
];
/* Workaround to allow use Servic... | php | protected function registerBaseServiceProviders()
{
$providers = [
AliasesServiceProvider::class,
\Collective\Html\HtmlServiceProvider::class,
BreadcrumbsServiceProvider::class,
AdminServiceProvider::class,
];
/* Workaround to allow use Servic... | [
"protected",
"function",
"registerBaseServiceProviders",
"(",
")",
"{",
"$",
"providers",
"=",
"[",
"AliasesServiceProvider",
"::",
"class",
",",
"\\",
"Collective",
"\\",
"Html",
"\\",
"HtmlServiceProvider",
"::",
"class",
",",
"BreadcrumbsServiceProvider",
"::",
"... | Register all of the base service providers.
@return void | [
"Register",
"all",
"of",
"the",
"base",
"service",
"providers",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Admin.php#L246-L263 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/OrderByClause.php | OrderByClause.loadRelationOrder | protected function loadRelationOrder(Builder $query, $direction)
{
/** @var Relation $relationClass */
$relations = collect(explode('.', $this->name));
$loop = 0;
if ($relations->count() >= 2) {
$query->select($query->getModel()->getTable().'.*');
do {
... | php | protected function loadRelationOrder(Builder $query, $direction)
{
/** @var Relation $relationClass */
$relations = collect(explode('.', $this->name));
$loop = 0;
if ($relations->count() >= 2) {
$query->select($query->getModel()->getTable().'.*');
do {
... | [
"protected",
"function",
"loadRelationOrder",
"(",
"Builder",
"$",
"query",
",",
"$",
"direction",
")",
"{",
"/** @var Relation $relationClass */",
"$",
"relations",
"=",
"collect",
"(",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"name",
")",
")",
";",
"... | Load Relations by this->name.
@param Builder $query
@param $direction | [
"Load",
"Relations",
"by",
"this",
"-",
">",
"name",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/OrderByClause.php#L104-L132 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/OrderByClause.php | OrderByClause.loadHasOne | protected function loadHasOne(
Collection $relations,
HasOneOrMany $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$this->loadHasOneOrMany($relations, $relationClass, $relationModel, $model, $query, $direction);
} | php | protected function loadHasOne(
Collection $relations,
HasOneOrMany $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$this->loadHasOneOrMany($relations, $relationClass, $relationModel, $model, $query, $direction);
} | [
"protected",
"function",
"loadHasOne",
"(",
"Collection",
"$",
"relations",
",",
"HasOneOrMany",
"$",
"relationClass",
",",
"Model",
"$",
"relationModel",
",",
"Model",
"$",
"model",
",",
"Builder",
"$",
"query",
",",
"$",
"direction",
")",
"{",
"$",
"this",... | Load HasOneOrMany keys.
@param Collection $relations
@param HasOneOrMany $relationClass
@param Model $relationModel
@param Model $model
@param Builder $query
@param $direction | [
"Load",
"HasOneOrMany",
"keys",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/OrderByClause.php#L143-L152 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/OrderByClause.php | OrderByClause.loadHasOneOrMany | protected function loadHasOneOrMany(
Collection $relations,
HasOneOrMany $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$ownerTable = $model->getTable();
$foreignTable = $relationModel->getTable();
$ownerCol... | php | protected function loadHasOneOrMany(
Collection $relations,
HasOneOrMany $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$ownerTable = $model->getTable();
$foreignTable = $relationModel->getTable();
$ownerCol... | [
"protected",
"function",
"loadHasOneOrMany",
"(",
"Collection",
"$",
"relations",
",",
"HasOneOrMany",
"$",
"relationClass",
",",
"Model",
"$",
"relationModel",
",",
"Model",
"$",
"model",
",",
"Builder",
"$",
"query",
",",
"$",
"direction",
")",
"{",
"$",
"... | Load HasOneOrMany keys.
@param Collection $relations
@param HasOneOrMany $relationClass
@param Model $relationModel
@param Model $model
@param Builder $query
@param $direction | [
"Load",
"HasOneOrMany",
"keys",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/OrderByClause.php#L183-L204 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/OrderByClause.php | OrderByClause.loadBelongsTo | protected function loadBelongsTo(
Collection $relations,
BelongsTo $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$foreignKey = $relationClass->getOwnerKey();
$ownerKey = $relationClass->getForeignKey();
$ow... | php | protected function loadBelongsTo(
Collection $relations,
BelongsTo $relationClass,
Model $relationModel,
Model $model,
Builder $query,
$direction
) {
$foreignKey = $relationClass->getOwnerKey();
$ownerKey = $relationClass->getForeignKey();
$ow... | [
"protected",
"function",
"loadBelongsTo",
"(",
"Collection",
"$",
"relations",
",",
"BelongsTo",
"$",
"relationClass",
",",
"Model",
"$",
"relationModel",
",",
"Model",
"$",
"model",
",",
"Builder",
"$",
"query",
",",
"$",
"direction",
")",
"{",
"$",
"foreig... | Load keys for BelongsTo.
@param Collection $relations
@param BelongsTo $relationClass
@param Model $relationModel
@param Model $model
@param Builder $query
@param $direction | [
"Load",
"keys",
"for",
"BelongsTo",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/OrderByClause.php#L215-L239 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.recursiveIterateElements | public function recursiveIterateElements(\Closure $callback)
{
// If Callback function returns TRUE then recurse iterator should stop.
$result = null;
foreach ($this->getElements() as $element) {
if ($element instanceof ElementsInterface) {
$result = $element->re... | php | public function recursiveIterateElements(\Closure $callback)
{
// If Callback function returns TRUE then recurse iterator should stop.
$result = null;
foreach ($this->getElements() as $element) {
if ($element instanceof ElementsInterface) {
$result = $element->re... | [
"public",
"function",
"recursiveIterateElements",
"(",
"\\",
"Closure",
"$",
"callback",
")",
"{",
"// If Callback function returns TRUE then recurse iterator should stop.",
"$",
"result",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"getElements",
"(",
")",
"... | @param \Closure $callback
@return bool|void | [
"@param",
"\\",
"Closure",
"$callback"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L40-L58 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.getElement | public function getElement($path)
{
$found = null;
foreach ($this->getElements() as $element) {
if ($element instanceof ElementsInterface) {
if (! is_null($found = $element->getElement($path))) {
return $found;
}
}
... | php | public function getElement($path)
{
$found = null;
foreach ($this->getElements() as $element) {
if ($element instanceof ElementsInterface) {
if (! is_null($found = $element->getElement($path))) {
return $found;
}
}
... | [
"public",
"function",
"getElement",
"(",
"$",
"path",
")",
"{",
"$",
"found",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"getElements",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"instanceof",
"ElementsInterface",
")... | @param string $path
@return FormElementInterface|null | [
"@param",
"string",
"$path"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L65-L80 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.setModelForElements | protected function setModelForElements(Model $model)
{
$this->getElements()->each(function ($element) use ($model) {
$element = $this->getElementContainer($element);
if ($element instanceof WithModelInterface) {
$element->setModel($model);
}
});
... | php | protected function setModelForElements(Model $model)
{
$this->getElements()->each(function ($element) use ($model) {
$element = $this->getElementContainer($element);
if ($element instanceof WithModelInterface) {
$element->setModel($model);
}
});
... | [
"protected",
"function",
"setModelForElements",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
")",
"use",
"(",
"$",
"model",
")",
"{",
"$",
"element",
"=",
"$",
"... | @param Model $model
@return $this | [
"@param",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L173-L184 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.getValidationRulesFromElements | protected function getValidationRulesFromElements(array $rules = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$rules) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$rules += $element->getValidation... | php | protected function getValidationRulesFromElements(array $rules = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$rules) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$rules += $element->getValidation... | [
"protected",
"function",
"getValidationRulesFromElements",
"(",
"array",
"$",
"rules",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"onlyActive",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
")",
"use",
"(",... | @param array $rules
@return array | [
"@param",
"array",
"$rules"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L191-L202 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.getValidationMessagesForElements | protected function getValidationMessagesForElements(array $messages = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$messages) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$messages += $element->ge... | php | protected function getValidationMessagesForElements(array $messages = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$messages) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$messages += $element->ge... | [
"protected",
"function",
"getValidationMessagesForElements",
"(",
"array",
"$",
"messages",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"onlyActive",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
")",
"use",
... | @param array $messages
@return array | [
"@param",
"array",
"$messages"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L209-L220 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.getValidationLabelsForElements | protected function getValidationLabelsForElements(array $labels = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$labels) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$labels += $element->getValidat... | php | protected function getValidationLabelsForElements(array $labels = [])
{
$this->getElements()->onlyActive()->each(function ($element) use (&$labels) {
$element = $this->getElementContainer($element);
if ($element instanceof Validable) {
$labels += $element->getValidat... | [
"protected",
"function",
"getValidationLabelsForElements",
"(",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"onlyActive",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
")",
"use",
"("... | @param array $labels
@return array | [
"@param",
"array",
"$labels"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L227-L238 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.saveElements | protected function saveElements(\Illuminate\Http\Request $request)
{
$this->getElements()->onlyActive()->each(function ($element) use ($request) {
$element = $this->getElementContainer($element);
if ($element instanceof FormElementInterface) {
$element->save($request... | php | protected function saveElements(\Illuminate\Http\Request $request)
{
$this->getElements()->onlyActive()->each(function ($element) use ($request) {
$element = $this->getElementContainer($element);
if ($element instanceof FormElementInterface) {
$element->save($request... | [
"protected",
"function",
"saveElements",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"onlyActive",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
")",
... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L245-L254 |
LaravelRUS/SleepingOwlAdmin | src/Traits/FormElements.php | FormElements.afterSaveElements | protected function afterSaveElements(\Illuminate\Http\Request $request)
{
$this->getElements()->onlyActive()->each(function ($element) use ($request) {
$element = $this->getElementContainer($element);
if ($element instanceof FormElementInterface) {
$element->afterSav... | php | protected function afterSaveElements(\Illuminate\Http\Request $request)
{
$this->getElements()->onlyActive()->each(function ($element) use ($request) {
$element = $this->getElementContainer($element);
if ($element instanceof FormElementInterface) {
$element->afterSav... | [
"protected",
"function",
"afterSaveElements",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"onlyActive",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"element",
... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/FormElements.php#L261-L270 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Actions.php | Actions.set | public function set($actions)
{
if (! is_array($actions)) {
$actions = func_get_args();
}
$this->clear();
foreach ($actions as $action) {
$this->push($action);
}
return $this->getDisplay();
} | php | public function set($actions)
{
if (! is_array($actions)) {
$actions = func_get_args();
}
$this->clear();
foreach ($actions as $action) {
$this->push($action);
}
return $this->getDisplay();
} | [
"public",
"function",
"set",
"(",
"$",
"actions",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"actions",
")",
")",
"{",
"$",
"actions",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
... | @param ActionInterface $actions
@return \SleepingOwl\Admin\Contracts\Display\DisplayInterface | [
"@param",
"ActionInterface",
"$actions"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Actions.php#L50-L63 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Actions.php | Actions.initialize | public function initialize()
{
if ($this->all()->count() < 1) {
return;
}
$this->all()->each(function (ActionInterface $action) {
$action->initialize();
});
$this->setHtmlAttribute('data-type', 'display-actions');
if (! $this->hasHtmlAttribu... | php | public function initialize()
{
if ($this->all()->count() < 1) {
return;
}
$this->all()->each(function (ActionInterface $action) {
$action->initialize();
});
$this->setHtmlAttribute('data-type', 'display-actions');
if (! $this->hasHtmlAttribu... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"all",
"(",
")",
"->",
"count",
"(",
")",
"<",
"1",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"all",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"ActionIn... | Initialize class. | [
"Initialize",
"class",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Actions.php#L142-L157 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/ManipulatesRequestRelations.php | ManipulatesRequestRelations.prepareRequestToBeCopied | protected function prepareRequestToBeCopied(Request $request)
{
$remove = [];
if ($request->method() === 'POST' && $request->input('next_action') === 'save_and_create') {
if (! $this->copyAfterSave) {
$remove[] = $this->relationName;
}
$this->makeC... | php | protected function prepareRequestToBeCopied(Request $request)
{
$remove = [];
if ($request->method() === 'POST' && $request->input('next_action') === 'save_and_create') {
if (! $this->copyAfterSave) {
$remove[] = $this->relationName;
}
$this->makeC... | [
"protected",
"function",
"prepareRequestToBeCopied",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"remove",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"request",
"->",
"method",
"(",
")",
"===",
"'POST'",
"&&",
"$",
"request",
"->",
"input",
"(",
"'next_actio... | Removes relation from request when it's in save_and_create mode.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Request | [
"Removes",
"relation",
"from",
"request",
"when",
"it",
"s",
"in",
"save_and_create",
"mode",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/ManipulatesRequestRelations.php#L33-L44 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/ManipulatesRequestRelations.php | ManipulatesRequestRelations.makeCopyOfRelations | protected function makeCopyOfRelations(\Illuminate\Http\Request $request)
{
$newData = [];
$data = $request->input($this->relationName, []);
$counter = 1;
$newKey = static::NEW_ITEM;
foreach ($data as $key => $values) {
$newData["{$newKey}_{$counter}"] = $values... | php | protected function makeCopyOfRelations(\Illuminate\Http\Request $request)
{
$newData = [];
$data = $request->input($this->relationName, []);
$counter = 1;
$newKey = static::NEW_ITEM;
foreach ($data as $key => $values) {
$newData["{$newKey}_{$counter}"] = $values... | [
"protected",
"function",
"makeCopyOfRelations",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"newData",
"=",
"[",
"]",
";",
"$",
"data",
"=",
"$",
"request",
"->",
"input",
"(",
"$",
"this",
"->",
"relationName",... | Creates a copy of form relations.
@param \Illuminate\Http\Request $request | [
"Creates",
"a",
"copy",
"of",
"form",
"relations",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/ManipulatesRequestRelations.php#L51-L65 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.postStore | public function postStore(ModelConfigurationInterface $model, Request $request)
{
if (! $model->isCreatable()) {
abort(404);
}
$createForm = $model->fireCreate();
$nextAction = $request->input('next_action');
$backUrl = $this->getBackUrl($request);
if (... | php | public function postStore(ModelConfigurationInterface $model, Request $request)
{
if (! $model->isCreatable()) {
abort(404);
}
$createForm = $model->fireCreate();
$nextAction = $request->input('next_action');
$backUrl = $this->getBackUrl($request);
if (... | [
"public",
"function",
"postStore",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"->",
"isCreatable",
"(",
")",
")",
"{",
"abort",
"(",
"404",
")",
";",
"}",
"$",
"createForm",
... | @param ModelConfigurationInterface $model
@param Request $request
@return \Illuminate\Http\RedirectResponse | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L319-L384 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.postUpdate | public function postUpdate(ModelConfigurationInterface $model, Request $request, $id)
{
/** @var FormInterface $editForm */
$editForm = $model->fireEdit($id);
$item = $editForm->getModel();
if (is_null($item) || ! $model->isEditable($item)) {
abort(404);
}
... | php | public function postUpdate(ModelConfigurationInterface $model, Request $request, $id)
{
/** @var FormInterface $editForm */
$editForm = $model->fireEdit($id);
$item = $editForm->getModel();
if (is_null($item) || ! $model->isEditable($item)) {
abort(404);
}
... | [
"public",
"function",
"postUpdate",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"/** @var FormInterface $editForm */",
"$",
"editForm",
"=",
"$",
"model",
"->",
"fireEdit",
"(",
"$",
"id",
")",
";... | @param ModelConfigurationInterface $model
@param Request $request
@param int $id
@return \Illuminate\Http\RedirectResponse
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"Request",
"$request",
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L418-L484 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.inlineEdit | public function inlineEdit(ModelConfigurationInterface $model, Request $request)
{
$field = $request->input('name');
$id = $request->input('pk');
$display = $model->fireDisplay();
$column = null;
/* @var ColumnEditableInterface|null $column */
if (is_callable([$displ... | php | public function inlineEdit(ModelConfigurationInterface $model, Request $request)
{
$field = $request->input('name');
$id = $request->input('pk');
$display = $model->fireDisplay();
$column = null;
/* @var ColumnEditableInterface|null $column */
if (is_callable([$displ... | [
"public",
"function",
"inlineEdit",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"field",
"=",
"$",
"request",
"->",
"input",
"(",
"'name'",
")",
";",
"$",
"id",
"=",
"$",
"request",
"->",
"input",
"(",... | @param ModelConfigurationInterface $model
@param Request $request
@return bool
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L494-L564 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.deleteDestroy | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id)
{
if (! $model->isRestorableModel()) {
abort(404);
}
$item = $model->getRepository()->findOnlyTrashed($id);
if (is_null($item) || ! $model->isRestorable($item)) {
abort(... | php | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id)
{
if (! $model->isRestorableModel()) {
abort(404);
}
$item = $model->getRepository()->findOnlyTrashed($id);
if (is_null($item) || ! $model->isRestorable($item)) {
abort(... | [
"public",
"function",
"deleteDestroy",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"->",
"isRestorableModel",
"(",
")",
")",
"{",
"abort",
"(",
"404",
")",
";",... | @param ModelConfigurationInterface $model
@param Request $request
@param int $id
@return \Illuminate\Http\RedirectResponse
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"Request",
"$request",
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L603-L627 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.postRestore | public function postRestore(ModelConfigurationInterface $model, Request $request, $id)
{
if (! $model->isRestorableModel()) {
abort(404);
}
$item = $model->getRepository()->findOnlyTrashed($id);
if (is_null($item) || ! $model->isRestorable($item)) {
abort(40... | php | public function postRestore(ModelConfigurationInterface $model, Request $request, $id)
{
if (! $model->isRestorableModel()) {
abort(404);
}
$item = $model->getRepository()->findOnlyTrashed($id);
if (is_null($item) || ! $model->isRestorable($item)) {
abort(40... | [
"public",
"function",
"postRestore",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"->",
"isRestorableModel",
"(",
")",
")",
"{",
"abort",
"(",
"404",
")",
";",
... | @param ModelConfigurationInterface|ModelConfiguration $model
@param Request $request
@param int $id
@return \Illuminate\Http\RedirectResponse
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | [
"@param",
"ModelConfigurationInterface|ModelConfiguration",
"$model",
"@param",
"Request",
"$request",
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L638-L662 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.render | public function render(ModelConfigurationInterface $model, $content, $title = null)
{
if ($content instanceof RedirectResponse) {
return $content;
}
if ($content instanceof Renderable) {
$content = $content->render();
}
if (is_null($title)) {
... | php | public function render(ModelConfigurationInterface $model, $content, $title = null)
{
if ($content instanceof RedirectResponse) {
return $content;
}
if ($content instanceof Renderable) {
$content = $content->render();
}
if (is_null($title)) {
... | [
"public",
"function",
"render",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"$",
"content",
",",
"$",
"title",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"RedirectResponse",
")",
"{",
"return",
"$",
"content",
";",
"}",
"if"... | @param ModelConfigurationInterface $model
@param Renderable|RedirectResponse|string $content
@param string|null $title
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\Illuminate\Http\RedirectResponse | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"Renderable|RedirectResponse|string",
"$content",
"@param",
"string|null",
"$title"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L671-L689 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.renderContent | public function renderContent($content, $title = null)
{
if ($content instanceof Renderable) {
$content = $content->render();
}
return $this->admin->template()->view('_layout.inner')
->with('title', $title)
->with('content', $content)
->with('... | php | public function renderContent($content, $title = null)
{
if ($content instanceof Renderable) {
$content = $content->render();
}
return $this->admin->template()->view('_layout.inner')
->with('title', $title)
->with('content', $content)
->with('... | [
"public",
"function",
"renderContent",
"(",
"$",
"content",
",",
"$",
"title",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"Renderable",
")",
"{",
"$",
"content",
"=",
"$",
"content",
"->",
"render",
"(",
")",
";",
"}",
"return",
... | @param Renderable|string $content
@param string|null $title
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"@param",
"Renderable|string",
"$content",
"@param",
"string|null",
"$title"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L697-L707 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/AdminController.php | AdminController.getBackUrl | protected function getBackUrl(Request $request)
{
if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) {
$backUrl = null;
$request->merge(['_redirectBack' => $backUrl]);
}
return $backUrl;
} | php | protected function getBackUrl(Request $request)
{
if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) {
$backUrl = null;
$request->merge(['_redirectBack' => $backUrl]);
}
return $backUrl;
} | [
"protected",
"function",
"getBackUrl",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"(",
"$",
"backUrl",
"=",
"$",
"request",
"->",
"input",
"(",
"'_redirectBack'",
")",
")",
"==",
"\\",
"URL",
"::",
"previous",
"(",
")",
")",
"{",
"$",
"back... | @param Request $request
@return null|string | [
"@param",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/AdminController.php#L714-L722 |
LaravelRUS/SleepingOwlAdmin | src/Display/Display.php | Display.extend | public function extend($name, DisplayExtensionInterface $extension)
{
$this->extensions->put($name, $extension);
$extension->setDisplay($this);
return $extension;
} | php | public function extend($name, DisplayExtensionInterface $extension)
{
$this->extensions->put($name, $extension);
$extension->setDisplay($this);
return $extension;
} | [
"public",
"function",
"extend",
"(",
"$",
"name",
",",
"DisplayExtensionInterface",
"$",
"extension",
")",
"{",
"$",
"this",
"->",
"extensions",
"->",
"put",
"(",
"$",
"name",
",",
"$",
"extension",
")",
";",
"$",
"extension",
"->",
"setDisplay",
"(",
"$... | @param string $name
@param DisplayExtensionInterface $extension
@return DisplayExtensionInterface | [
"@param",
"string",
"$name",
"@param",
"DisplayExtensionInterface",
"$extension"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Display.php#L104-L111 |
LaravelRUS/SleepingOwlAdmin | src/Display/Display.php | Display.render | public function render()
{
$view = app('sleeping_owl.template')->view($this->getView(), $this->toArray());
$blocks = $this->getExtensions()->placableBlocks();
foreach ($blocks as $block => $data) {
foreach ($data as $html) {
if (! empty($html)) {
... | php | public function render()
{
$view = app('sleeping_owl.template')->view($this->getView(), $this->toArray());
$blocks = $this->getExtensions()->placableBlocks();
foreach ($blocks as $block => $data) {
foreach ($data as $html) {
if (! empty($html)) {
... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"view",
"=",
"app",
"(",
"'sleeping_owl.template'",
")",
"->",
"view",
"(",
"$",
"this",
"->",
"getView",
"(",
")",
",",
"$",
"this",
"->",
"toArray",
"(",
")",
")",
";",
"$",
"blocks",
"=",
"$",
... | Get the evaluated contents of the object.
@return string | [
"Get",
"the",
"evaluated",
"contents",
"of",
"the",
"object",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Display.php#L235-L254 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Password.php | Password.save | public function save(\Illuminate\Http\Request $request)
{
$value = $this->getValueFromModel();
if (! $this->isAllowedEmptyValue() && $this->getModel()->exists && empty($value)) {
return;
}
parent::save($request);
} | php | public function save(\Illuminate\Http\Request $request)
{
$value = $this->getValueFromModel();
if (! $this->isAllowedEmptyValue() && $this->getModel()->exists && empty($value)) {
return;
}
parent::save($request);
} | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValueFromModel",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isAllowedEmptyValue",
"(",
")"... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Password.php#L32-L41 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/DisplayColumnController.php | DisplayColumnController.orderUp | public function orderUp(ModelConfigurationInterface $model, $id)
{
/** @var OrderableModel $instance */
$instance = $model->getRepository()->find($id);
$instance->moveUp();
return back();
} | php | public function orderUp(ModelConfigurationInterface $model, $id)
{
/** @var OrderableModel $instance */
$instance = $model->getRepository()->find($id);
$instance->moveUp();
return back();
} | [
"public",
"function",
"orderUp",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"$",
"id",
")",
"{",
"/** @var OrderableModel $instance */",
"$",
"instance",
"=",
"$",
"model",
"->",
"getRepository",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
... | @param ModelConfigurationInterface $model
@param int $id
@return \Illuminate\Http\RedirectResponse | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/DisplayColumnController.php#L17-L24 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/DisplayColumnController.php | DisplayColumnController.orderDown | public function orderDown(ModelConfigurationInterface $model, $id)
{
/** @var OrderableModel $instance */
$instance = $model->getRepository()->find($id);
$instance->moveDown();
return back();
} | php | public function orderDown(ModelConfigurationInterface $model, $id)
{
/** @var OrderableModel $instance */
$instance = $model->getRepository()->find($id);
$instance->moveDown();
return back();
} | [
"public",
"function",
"orderDown",
"(",
"ModelConfigurationInterface",
"$",
"model",
",",
"$",
"id",
")",
"{",
"/** @var OrderableModel $instance */",
"$",
"instance",
"=",
"$",
"model",
"->",
"getRepository",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
... | @param ModelConfigurationInterface $model
@param int $id
@return \Illuminate\Http\RedirectResponse | [
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/DisplayColumnController.php#L32-L39 |
LaravelRUS/SleepingOwlAdmin | src/Traits/OrderableModel.php | OrderableModel.bootOrderableModel | protected static function bootOrderableModel()
{
static::creating(function (Model $row) {
$row->updateOrderFieldOnCreate();
});
static::deleted(function (Model $row) {
$row->updateOrderFieldOnDelete();
});
if (in_array("Illuminate\Database\Eloquent\S... | php | protected static function bootOrderableModel()
{
static::creating(function (Model $row) {
$row->updateOrderFieldOnCreate();
});
static::deleted(function (Model $row) {
$row->updateOrderFieldOnDelete();
});
if (in_array("Illuminate\Database\Eloquent\S... | [
"protected",
"static",
"function",
"bootOrderableModel",
"(",
")",
"{",
"static",
"::",
"creating",
"(",
"function",
"(",
"Model",
"$",
"row",
")",
"{",
"$",
"row",
"->",
"updateOrderFieldOnCreate",
"(",
")",
";",
"}",
")",
";",
"static",
"::",
"deleted",
... | Boot trait. | [
"Boot",
"trait",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/OrderableModel.php#L18-L33 |
LaravelRUS/SleepingOwlAdmin | src/Traits/OrderableModel.php | OrderableModel.move | protected function move($destination)
{
if ($previousRow = static::orderModel()->findByPosition($this->getOrderValue() - $destination)->first()) {
$previousRow->{$this->getOrderField()} += $destination;
$previousRow->save();
}
$this->{$this->getOrderField()} -= $dest... | php | protected function move($destination)
{
if ($previousRow = static::orderModel()->findByPosition($this->getOrderValue() - $destination)->first()) {
$previousRow->{$this->getOrderField()} += $destination;
$previousRow->save();
}
$this->{$this->getOrderField()} -= $dest... | [
"protected",
"function",
"move",
"(",
"$",
"destination",
")",
"{",
"if",
"(",
"$",
"previousRow",
"=",
"static",
"::",
"orderModel",
"(",
")",
"->",
"findByPosition",
"(",
"$",
"this",
"->",
"getOrderValue",
"(",
")",
"-",
"$",
"destination",
")",
"->",... | Move model in the $destination.
@param $destination -1 (move down) or 1 (move up) | [
"Move",
"model",
"in",
"the",
"$destination",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/OrderableModel.php#L65-L74 |
LaravelRUS/SleepingOwlAdmin | src/Traits/OrderableModel.php | OrderableModel.updateOrderFieldOnDelete | protected function updateOrderFieldOnDelete()
{
static::orderModel()
->where($this->getOrderField(), '>', $this->getOrderValue())
->decrement($this->getOrderField());
} | php | protected function updateOrderFieldOnDelete()
{
static::orderModel()
->where($this->getOrderField(), '>', $this->getOrderValue())
->decrement($this->getOrderField());
} | [
"protected",
"function",
"updateOrderFieldOnDelete",
"(",
")",
"{",
"static",
"::",
"orderModel",
"(",
")",
"->",
"where",
"(",
"$",
"this",
"->",
"getOrderField",
"(",
")",
",",
"'>'",
",",
"$",
"this",
"->",
"getOrderValue",
"(",
")",
")",
"->",
"decre... | Update order field on delete. | [
"Update",
"order",
"field",
"on",
"delete",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/OrderableModel.php#L87-L92 |
LaravelRUS/SleepingOwlAdmin | src/Traits/OrderableModel.php | OrderableModel.updateOrderFieldOnRestore | protected function updateOrderFieldOnRestore()
{
static::orderModel()
->where($this->getOrderField(), '>', $this->getOrderValue())
->increment($this->getOrderField());
} | php | protected function updateOrderFieldOnRestore()
{
static::orderModel()
->where($this->getOrderField(), '>', $this->getOrderValue())
->increment($this->getOrderField());
} | [
"protected",
"function",
"updateOrderFieldOnRestore",
"(",
")",
"{",
"static",
"::",
"orderModel",
"(",
")",
"->",
"where",
"(",
"$",
"this",
"->",
"getOrderField",
"(",
")",
",",
"'>'",
",",
"$",
"this",
"->",
"getOrderValue",
"(",
")",
")",
"->",
"incr... | Update order field on restore. | [
"Update",
"order",
"field",
"on",
"restore",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/OrderableModel.php#L97-L102 |
LaravelRUS/SleepingOwlAdmin | src/Traits/OrderableModel.php | OrderableModel.scopeOrderModel | public function scopeOrderModel($query)
{
$parentFields = $this->getParentFieldName();
if ($parentFields) {
$parentFields = (array) $parentFields;
foreach ($parentFields as $parentFieldName) {
$query->where($parentFieldName, $this->{$parentFieldName});
... | php | public function scopeOrderModel($query)
{
$parentFields = $this->getParentFieldName();
if ($parentFields) {
$parentFields = (array) $parentFields;
foreach ($parentFields as $parentFieldName) {
$query->where($parentFieldName, $this->{$parentFieldName});
... | [
"public",
"function",
"scopeOrderModel",
"(",
"$",
"query",
")",
"{",
"$",
"parentFields",
"=",
"$",
"this",
"->",
"getParentFieldName",
"(",
")",
";",
"if",
"(",
"$",
"parentFields",
")",
"{",
"$",
"parentFields",
"=",
"(",
"array",
")",
"$",
"parentFie... | Order scope.
@param $query
@return mixed | [
"Order",
"scope",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Traits/OrderableModel.php#L111-L122 |
LaravelRUS/SleepingOwlAdmin | src/Navigation/Page.php | Page.setAliasId | public function setAliasId()
{
$url = parse_url($this->getUrl(), PHP_URL_PATH);
if ($url) {
$this->aliasId = md5($url);
}
} | php | public function setAliasId()
{
$url = parse_url($this->getUrl(), PHP_URL_PATH);
if ($url) {
$this->aliasId = md5($url);
}
} | [
"public",
"function",
"setAliasId",
"(",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"this",
"->",
"getUrl",
"(",
")",
",",
"PHP_URL_PATH",
")",
";",
"if",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"aliasId",
"=",
"md5",
"(",
"$",
"url"... | Set Alias Id. | [
"Set",
"Alias",
"Id",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Navigation/Page.php#L39-L45 |
LaravelRUS/SleepingOwlAdmin | src/Navigation/Page.php | Page.render | public function render($view = null)
{
if ($this->hasChild() && ! $this->hasClassProperty($class = config('navigation.class.has_child', 'treeview'))) {
$this->setHtmlAttribute('class', $class);
}
$data = $this->toArray();
if (! is_null($view)) {
return view(... | php | public function render($view = null)
{
if ($this->hasChild() && ! $this->hasClassProperty($class = config('navigation.class.has_child', 'treeview'))) {
$this->setHtmlAttribute('class', $class);
}
$data = $this->toArray();
if (! is_null($view)) {
return view(... | [
"public",
"function",
"render",
"(",
"$",
"view",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasChild",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"hasClassProperty",
"(",
"$",
"class",
"=",
"config",
"(",
"'navigation.class.has_child'",
",",
"... | @param string|null $view
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"@param",
"string|null",
"$view"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Navigation/Page.php#L132-L145 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Breadcrumbs.php | Breadcrumbs.renderIfExists | public function renderIfExists($name = null)
{
if (is_null($name)) {
$params = $this->currentRoute->get();
$name = $params[0];
}
if (! $this->exists($name)) {
return '';
}
return $this->render($name);
} | php | public function renderIfExists($name = null)
{
if (is_null($name)) {
$params = $this->currentRoute->get();
$name = $params[0];
}
if (! $this->exists($name)) {
return '';
}
return $this->render($name);
} | [
"public",
"function",
"renderIfExists",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"currentRoute",
"->",
"get",
"(",
")",
";",
"$",
"name",
"=",
"$",
"par... | @param string|null $name
@return string | [
"@param",
"string|null",
"$name"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Breadcrumbs.php#L31-L43 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Breadcrumbs.php | Breadcrumbs.renderArray | public function renderArray($name, $params = [])
{
return $this->view($this->generator->generate($this->callbacks, $name, $params));
} | php | public function renderArray($name, $params = [])
{
return $this->view($this->generator->generate($this->callbacks, $name, $params));
} | [
"public",
"function",
"renderArray",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"view",
"(",
"$",
"this",
"->",
"generator",
"->",
"generate",
"(",
"$",
"this",
"->",
"callbacks",
",",
"$",
"name",
"... | @param string $name
@param array $params
@return string | [
"@param",
"string",
"$name",
"@param",
"array",
"$params"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Breadcrumbs.php#L51-L54 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Breadcrumbs.php | Breadcrumbs.renderIfExistsArray | public function renderIfExistsArray($name, $params = [])
{
if (! $this->exists($name)) {
return '';
}
return $this->renderArray($name, $params);
} | php | public function renderIfExistsArray($name, $params = [])
{
if (! $this->exists($name)) {
return '';
}
return $this->renderArray($name, $params);
} | [
"public",
"function",
"renderIfExistsArray",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
"$",
"name",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"rend... | @param string $name
@param array $params
@return string | [
"@param",
"string",
"$name",
"@param",
"array",
"$params"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Breadcrumbs.php#L62-L69 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Upload.php | Upload.save | public function save(\Illuminate\Http\Request $request)
{
$value = $this->getValueFromRequest($request);
if ($request->input($this->getPath().'_remove')) {
$this->setModelAttribute(null);
} elseif (! is_null($value)) {
$this->setModelAttribute($value);
}
... | php | public function save(\Illuminate\Http\Request $request)
{
$value = $this->getValueFromRequest($request);
if ($request->input($this->getPath().'_remove')) {
$this->setModelAttribute(null);
} elseif (! is_null($value)) {
$this->setModelAttribute($value);
}
... | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValueFromRequest",
"(",
"$",
"request",
")",
";",
"if",
"(",
"$",
"request",
"->",
"input",
"(",
... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Upload.php#L39-L48 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Textarea.php | Textarea.setRows | public function setRows($rows)
{
intval($rows);
if ($rows < 1) {
$rows = 1;
}
$this->rows = $rows;
return $this;
} | php | public function setRows($rows)
{
intval($rows);
if ($rows < 1) {
$rows = 1;
}
$this->rows = $rows;
return $this;
} | [
"public",
"function",
"setRows",
"(",
"$",
"rows",
")",
"{",
"intval",
"(",
"$",
"rows",
")",
";",
"if",
"(",
"$",
"rows",
"<",
"1",
")",
"{",
"$",
"rows",
"=",
"1",
";",
"}",
"$",
"this",
"->",
"rows",
"=",
"$",
"rows",
";",
"return",
"$",
... | @param int $rows
@return $this | [
"@param",
"int",
"$rows"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Textarea.php#L30-L40 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Order.php | Order.registerRoutes | public static function registerRoutes(Router $router)
{
$routeName = 'admin.display.column.move-up';
if (! $router->has($routeName)) {
$router->group(['namespace' => 'SleepingOwl\Admin\Http\Controllers'],
function ($router) use ($routeName) {
$router->... | php | public static function registerRoutes(Router $router)
{
$routeName = 'admin.display.column.move-up';
if (! $router->has($routeName)) {
$router->group(['namespace' => 'SleepingOwl\Admin\Http\Controllers'],
function ($router) use ($routeName) {
$router->... | [
"public",
"static",
"function",
"registerRoutes",
"(",
"Router",
"$",
"router",
")",
"{",
"$",
"routeName",
"=",
"'admin.display.column.move-up'",
";",
"if",
"(",
"!",
"$",
"router",
"->",
"has",
"(",
"$",
"routeName",
")",
")",
"{",
"$",
"router",
"->",
... | Register routes.
@param Router $router | [
"Register",
"routes",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Order.php#L33-L56 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.getCompositeKey | protected function getCompositeKey($item, array $columns): string
{
$primaries = [];
if ($item instanceof Model) {
$item = $item->getAttributes();
}
foreach ($columns as $name) {
// Only existing keys must be in primaries array
if (array_key_exist... | php | protected function getCompositeKey($item, array $columns): string
{
$primaries = [];
if ($item instanceof Model) {
$item = $item->getAttributes();
}
foreach ($columns as $name) {
// Only existing keys must be in primaries array
if (array_key_exist... | [
"protected",
"function",
"getCompositeKey",
"(",
"$",
"item",
",",
"array",
"$",
"columns",
")",
":",
"string",
"{",
"$",
"primaries",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"item",
"instanceof",
"Model",
")",
"{",
"$",
"item",
"=",
"$",
"item",
"->",
... | @param $item
@param array $columns
@return string | [
"@param",
"$item"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L192-L207 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.setModel | public function setModel(Model $model)
{
parent::setModel($model);
if ($model->exists) {
$this->setInstance($model);
$this->loadRelationValues();
}
} | php | public function setModel(Model $model)
{
parent::setModel($model);
if ($model->exists) {
$this->setInstance($model);
$this->loadRelationValues();
}
} | [
"public",
"function",
"setModel",
"(",
"Model",
"$",
"model",
")",
"{",
"parent",
"::",
"setModel",
"(",
"$",
"model",
")",
";",
"if",
"(",
"$",
"model",
"->",
"exists",
")",
"{",
"$",
"this",
"->",
"setInstance",
"(",
"$",
"model",
")",
";",
"$",
... | @param Model $model
@return FormElements|void
@throws \Illuminate\Database\Eloquent\ModelNotFoundException | [
"@param",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L259-L267 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.getElementValue | protected function getElementValue(Model $model, NamedFormElement $el)
{
$attribute = $el->getModelAttributeKey();
if (strpos($attribute, '->') === false) {
return $model->getAttribute($attribute);
}
// Parse json attributes
$casts = collect($model->getCasts());
... | php | protected function getElementValue(Model $model, NamedFormElement $el)
{
$attribute = $el->getModelAttributeKey();
if (strpos($attribute, '->') === false) {
return $model->getAttribute($attribute);
}
// Parse json attributes
$casts = collect($model->getCasts());
... | [
"protected",
"function",
"getElementValue",
"(",
"Model",
"$",
"model",
",",
"NamedFormElement",
"$",
"el",
")",
"{",
"$",
"attribute",
"=",
"$",
"el",
"->",
"getModelAttributeKey",
"(",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"attribute",
",",
"'->'",
... | Returns value from model for given element.
@param \Illuminate\Database\Eloquent\Model $model
@param NamedFormElement $el
@return mixed|null | [
"Returns",
"value",
"from",
"model",
"for",
"given",
"element",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L426-L445 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.forEachElement | protected function forEachElement(Collection $elements, $callback)
{
foreach ($this->flatNamedElements($elements) as $element) {
$callback($element);
}
} | php | protected function forEachElement(Collection $elements, $callback)
{
foreach ($this->flatNamedElements($elements) as $element) {
$callback($element);
}
} | [
"protected",
"function",
"forEachElement",
"(",
"Collection",
"$",
"elements",
",",
"$",
"callback",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"flatNamedElements",
"(",
"$",
"elements",
")",
"as",
"$",
"element",
")",
"{",
"$",
"callback",
"(",
"$",
"... | Applies given callback to every element of form.
@param \Illuminate\Support\Collection $elements
@param $callback | [
"Applies",
"given",
"callback",
"to",
"every",
"element",
"of",
"form",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L458-L463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.