Skip to content

Instantly share code, notes, and snippets.

View lazychaser's full-sized avatar

Alexander Kalnoy lazychaser

View GitHub Profile
<!doctype html>
<html lang="ru">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
# Список внешних переменных
# Их можно подставлять в тексте с префиксом $, например $price
variables:
minPrice: Минимальная цена
maxPrice: Максимальная цена
# Список всех шагов
# Обязательно должен быть шаг start -- это начальный шаг
steps:
# Самое первое действие
<?php return [
'storage' => [
'files' => [
// The type of the storage can be `files` or `images`
'type' => 'files',
// This is the disk that is defined in the filesystems config
'disk' => 'files',
],
$lang = 'de';
$rootId = 1;
$categories = Category::whereDescendantOf($rootId)
->leftJoin('category_translations as tr', 'tr.category_id', '=', 'categories.id')
->where('tr.code', '=', $lang)
->get([ 'categories.*', 'tr.name' ])
->toTree();
<?php
class Category extends Model
{
use Kalnoy\Nestedset\NodeTrait;
public function urlPath()
{
return $this->morphOne(UrlPath::class, 'model');
}
<?php
namespace App\Backend;
use App\Components\Core\User;
use Illuminate\Contracts\Auth\Authenticatable;
use Kalnoy\Cruddy\BaseForm;
use Kalnoy\Cruddy\Contracts\Permissions as PermissionsContract;
use Kalnoy\Cruddy\Entity;
use Illuminate\Config\Repository;