first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
.env
|
||||||
|
/node_modules
|
||||||
|
/vendor
|
||||||
|
/sourcefiles
|
||||||
|
/storage
|
||||||
BIN
Binary file not shown.
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
Generated
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
Generated
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Codeception">
|
||||||
|
<option name="configurations">
|
||||||
|
<list>
|
||||||
|
<Configuration>
|
||||||
|
<option name="path" value="$PROJECT_DIR$/tests" />
|
||||||
|
</Configuration>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="ntspi_db" uuid="3543eabb-ce62-4a3e-9580-690452ad4f73">
|
||||||
|
<driver-ref>mysql.8</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:mysql://localhost:3306/ntspi_db</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/ntspi-new.iml" filepath="$PROJECT_DIR$/.idea/ntspi-new.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+181
@@ -0,0 +1,181 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/carbonphp/carbon-doctrine-types" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/dflydev/dot-access-data" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/fakerphp/faker" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/fruitcake/php-cors" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/uri-template" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/inertiajs/inertia-laravel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/intervention/image" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/breeze" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/framework" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/pint" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/prompts" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sail" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sanctum" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/serializable-closure" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/tinker" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/commonmark" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/config" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem-local" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/mime-type-detection" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/schema" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/utils" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/termwind" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psy/psysh" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/collection" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-permission" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/error-handler" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-uuid" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/uid" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/tightenco/ziggy" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/anourvalar/eloquent-serialize" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/blade-ui-kit/blade-heroicons" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/blade-ui-kit/blade-icons" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/danharrin/date-format-converter" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/danharrin/livewire-rate-limiting" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/event-manager" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/actions" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/filament" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/forms" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/infolists" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/notifications" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/spatie-laravel-tags-plugin" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/support" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/tables" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/filament/widgets" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/kirschbaum-development/eloquent-power-joins" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/csv" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/uri" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/uri-interfaces" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/livewire/livewire" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/masterminds/html5" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/openspout/openspout" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ryangjchandler/blade-capture-directive" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/color" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/eloquent-sortable" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/invade" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-package-tools" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-tags" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-translatable" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/html-sanitizer" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/awcodes/filament-tiptap-editor" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/mohamedsabil83/filament-forms-tinyeditor" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/rahmanramsi/filament-editorjs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/scrivo/highlight.php" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/shiki-php" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ueberdosis/tiptap-php" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/protonemedia/laravel-cross-eloquent-search" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/xvladqt/faker-lorem-flickr" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/maximebf/debugbar" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/ezyang/htmlpurifier" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/maennchen/zipstream-php" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/complex" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/matrix" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpspreadsheet" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/pxlrbt/filament-excel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/guava/filament-icon-picker" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/joshembling/image-optimizer" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
Generated
+201
@@ -0,0 +1,201 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="LaravelPint">
|
||||||
|
<laravel_pint_settings>
|
||||||
|
<LaravelPintConfiguration tool_path="$PROJECT_DIR$/vendor/bin/pint" />
|
||||||
|
</laravel_pint_settings>
|
||||||
|
</component>
|
||||||
|
<component name="MessDetectorOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCSFixerOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||||
|
<option name="highlightLevel" value="WARNING" />
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PhpIncludePathManager">
|
||||||
|
<include_path>
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nunomaduro/termwind" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/config" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/commonmark" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/sail" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/flysystem-local" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/prompts" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/pint" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/sanctum" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/tinker" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/serializable-closure" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/framework" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/laravel/breeze" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/fakerphp/faker" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/carbonphp/carbon-doctrine-types" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/clock" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/container" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/laravel-permission" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/log" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/fruitcake/php-cors" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/inertiajs/inertia-laravel" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/tightenco/ziggy" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/console" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/uid" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/string" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/process" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-uuid" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ramsey/collection" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ramsey/uuid" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/intervention/image" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psy/psysh" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/brick/math" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/guzzlehttp/uri-template" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/dflydev/dot-access-data" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nette/schema" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nette/utils" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/danharrin/date-format-converter" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/danharrin/livewire-rate-limiting" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/blade-ui-kit/blade-icons" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/blade-ui-kit/blade-heroicons" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/kirschbaum-development/eloquent-power-joins" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/livewire/livewire" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ryangjchandler/blade-capture-directive" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/forms" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/tables" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/filament" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/infolists" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/actions" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/support" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/widgets" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/notifications" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/masterminds/html5" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/invade" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/laravel-package-tools" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/color" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/anourvalar/eloquent-serialize" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/openspout/openspout" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/csv" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/uri-interfaces" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/league/uri" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/psr/cache" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/symfony/html-sanitizer" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/cache" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/filament/spatie-laravel-tags-plugin" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/eloquent-sortable" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/laravel-translatable" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/laravel-tags" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ueberdosis/tiptap-php" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/awcodes/filament-tiptap-editor" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/scrivo/highlight.php" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/spatie/shiki-php" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/rahmanramsi/filament-editorjs" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/protonemedia/laravel-cross-eloquent-search" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/mohamedsabil83/filament-forms-tinyeditor" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/xvladqt/faker-lorem-flickr" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/maennchen/zipstream-php" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/maatwebsite/excel" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/markbaker/matrix" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/markbaker/complex" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/ezyang/htmlpurifier" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/pxlrbt/filament-excel" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/guava/filament-icon-picker" />
|
||||||
|
<path value="$PROJECT_DIR$/vendor/joshembling/image-optimizer" />
|
||||||
|
</include_path>
|
||||||
|
</component>
|
||||||
|
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
|
||||||
|
<component name="PhpStanOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PhpUnit">
|
||||||
|
<phpunit_settings>
|
||||||
|
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
|
||||||
|
</phpunit_settings>
|
||||||
|
</component>
|
||||||
|
<component name="PsalmOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+61
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PHPSpec">
|
||||||
|
<suites>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
<PhpSpecSuiteConfiguration>
|
||||||
|
<option name="myPath" value="$PROJECT_DIR$" />
|
||||||
|
</PhpSpecSuiteConfiguration>
|
||||||
|
</suites>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PHPUnit">
|
||||||
|
<option name="directories">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/tests" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# NTSPI-NEW
|
||||||
|
### Клонируйте репозиторий с GitHub:
|
||||||
|
|
||||||
|
```git
|
||||||
|
git clone https://github.com/F4ilji/ntspi-new.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Установка контейнеров с помощью Docker.
|
||||||
|
|
||||||
|
Перейдите в директорию проекта:
|
||||||
|
```bash
|
||||||
|
cd ntspi-new
|
||||||
|
```
|
||||||
|
Запустите контейнеры с помощью Docker Compose:
|
||||||
|
```docker
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### Установка зависимостей
|
||||||
|
Зайдите в контейнер ntspi-php:
|
||||||
|
```docker
|
||||||
|
docker exec -it ntspi-php bash
|
||||||
|
```
|
||||||
|
Установите зависимости Composer:
|
||||||
|
```composer
|
||||||
|
composer install
|
||||||
|
```
|
||||||
|
Установите зависимости NPM:
|
||||||
|
```npm
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
Сгенерируйте новый ключ приложения:
|
||||||
|
```php
|
||||||
|
php artisan key:generate
|
||||||
|
```
|
||||||
|
Создайте файл .env на основе .env.example:
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
Настройте подключение к базе данных в файле .env:
|
||||||
|
```env
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
DB_HOST=mysql
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=ntspi_db
|
||||||
|
DB_USERNAME=admin
|
||||||
|
DB_PASSWORD=secret
|
||||||
|
```
|
||||||
|
|
||||||
|
### Миграция и заполнение базы данных
|
||||||
|
Выполните миграции и заполнение базы данных:
|
||||||
|
```php
|
||||||
|
php artisan migrate --seed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Запуск js билдера
|
||||||
|
```npm
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](https://choosealicense.com/licenses/mit/)
|
||||||
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,52 @@
|
|||||||
|
FROM php:8.2-fpm
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
libpq-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libgd-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
libzip-dev \
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
git && \
|
||||||
|
docker-php-ext-configure gd --with-webp --with-jpeg && \
|
||||||
|
docker-php-ext-install gd && \
|
||||||
|
docker-php-ext-install pdo_mysql && \
|
||||||
|
docker-php-ext-install bcmath && \
|
||||||
|
docker-php-ext-install zip && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
#RUN apt-get update && \
|
||||||
|
# apt-get install -y libmagickwand-dev
|
||||||
|
#
|
||||||
|
#RUN pecl install imagick
|
||||||
|
#
|
||||||
|
#RUN docker-php-ext-enable imagick
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++
|
||||||
|
RUN docker-php-ext-configure intl
|
||||||
|
RUN docker-php-ext-install intl
|
||||||
|
|
||||||
|
|
||||||
|
COPY ./_docker/app/php.ini /usr/local/etc/php/conf.d/php.ini
|
||||||
|
|
||||||
|
# Установка Node.js
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
|
||||||
|
RUN apt-get install -y nodejs npm
|
||||||
|
|
||||||
|
EXPOSE 6001
|
||||||
|
EXPOSE 5173
|
||||||
|
|
||||||
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php -- \
|
||||||
|
--filename=composer \
|
||||||
|
--install-dir=/usr/local/bin
|
||||||
|
|
||||||
|
WORKDIR /var/www
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
post_max_size = 128M
|
||||||
|
upload_max_filesize = 128M
|
||||||
|
memory_limit = 256M
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
server {
|
||||||
|
client_max_body_size 200M;
|
||||||
|
root /var/www/public;
|
||||||
|
location / {
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
try_files $uri /index.php?$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /sveden/ {
|
||||||
|
alias /var/www/public/sveden/;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /sveden/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass app:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Models\Page;
|
||||||
|
|
||||||
|
|
||||||
|
class RegisterRoutes extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'routes:register';
|
||||||
|
protected $description = 'Register application routes in the database';
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$routes = Route::getRoutes();
|
||||||
|
|
||||||
|
foreach ($routes as $route) {
|
||||||
|
// Проверяем, существует ли маршрут в базе данных
|
||||||
|
if (!Page::where('path', '=', $route->uri)->where('is_registered', '=', true)->exists()) {
|
||||||
|
// Если не существует, создаем новую запись
|
||||||
|
Page::create([
|
||||||
|
'path' => $route->uri,
|
||||||
|
'is_registered' => true,
|
||||||
|
'is_url' => false,
|
||||||
|
'searchable' => false,
|
||||||
|
'code' => 200,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->info("Route registered: " . $route->uri);
|
||||||
|
} else {
|
||||||
|
$this->info("Route already registered: " . $route->uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('All routes have been processed.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console;
|
||||||
|
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
|
class Kernel extends ConsoleKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the application's command schedule.
|
||||||
|
*/
|
||||||
|
protected function schedule(Schedule $schedule): void
|
||||||
|
{
|
||||||
|
// $schedule->command('inspire')->hourly();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the commands for the application.
|
||||||
|
*/
|
||||||
|
protected function commands(): void
|
||||||
|
{
|
||||||
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
|
require base_path('routes/console.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum BudgetEducation: int implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
case budget_quantity_position = 1; // Очная форма обучения
|
||||||
|
case non_budget_quantity_position = 2; // Заочная форма обучения
|
||||||
|
|
||||||
|
public static function fromName(string $name): ?self {
|
||||||
|
return match ($name) {
|
||||||
|
'budget_quantity_position' => self::budget_quantity_position,
|
||||||
|
'non_budget_quantity_position' => self::non_budget_quantity_position,
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::budget_quantity_position => 'Бюджетные места',
|
||||||
|
self::non_budget_quantity_position => 'С оплатой обучения',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::budget_quantity_position => 'success', // Цвет для очной формы
|
||||||
|
self::non_budget_quantity_position => 'warning', // Цвет для заочной формы
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum CustomFormStatus: string implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
|
||||||
|
case PUBLISHED = 'published';
|
||||||
|
case HIDDEN = 'hidden';
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PUBLISHED => 'Опубликовано',
|
||||||
|
self::HIDDEN => 'Скрыто',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PUBLISHED => 'success',
|
||||||
|
self::HIDDEN => 'gray',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum EducationalProgramStatus: int implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
case PUBLISHED = 1; // Опубликована. Отображается в публичной части сайта
|
||||||
|
case IN_PROGRESS = 2; // На стадии заполнения. Отображается только в редакторе
|
||||||
|
case ARCHIVED = 3; // Архивная. Отображается только в разделе Абитуриенту и в таблице сведений о трудоустройстве выпускников
|
||||||
|
case REFERENCE = 4; // Справочная. Отображается только в разделе "Образование" и других
|
||||||
|
case NOT_IMPLEMENTED = 5; // Не реализуется. Отображается только в справочнике образовательных программ
|
||||||
|
case LICENSE_PENDING = 6; // Представлена к лицензированию. Отображается только в разделе "Образование"
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PUBLISHED => 'Опубликована. Отображается в публичной части сайта',
|
||||||
|
self::IN_PROGRESS => 'На стадии заполнения. Отображается только в редакторе',
|
||||||
|
self::ARCHIVED => 'Архивная. Отображается только в разделе Абитуриенту и в таблице сведений о трудоустройстве выпускников',
|
||||||
|
self::REFERENCE => 'Справочная. Отображается только в разделе "Образование" и других',
|
||||||
|
self::NOT_IMPLEMENTED => 'Не реализуется. Отображается только в справочнике образовательных программ',
|
||||||
|
self::LICENSE_PENDING => 'Представлена к лицензированию. Отображается только в разделе "Образование"',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PUBLISHED => 'success',
|
||||||
|
self::IN_PROGRESS => 'warning',
|
||||||
|
self::ARCHIVED => 'secondary',
|
||||||
|
self::REFERENCE => 'info',
|
||||||
|
self::NOT_IMPLEMENTED => 'danger',
|
||||||
|
self::LICENSE_PENDING => 'primary',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum FormEducation: int implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
case FULL_TIME = 1; // Очная форма обучения
|
||||||
|
case PART_TIME = 2; // Заочная форма обучения
|
||||||
|
|
||||||
|
public static function fromName(string $name): ?self {
|
||||||
|
return match ($name) {
|
||||||
|
'FULL_TIME' => self::FULL_TIME,
|
||||||
|
'PART_TIME' => self::PART_TIME,
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::FULL_TIME => 'Очная форма обучения',
|
||||||
|
self::PART_TIME => 'Заочная форма обучения',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::FULL_TIME => 'success', // Цвет для очной формы
|
||||||
|
self::PART_TIME => 'warning', // Цвет для заочной формы
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum LevelEducational: int implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
case PREPARATION_OF_QUALIFIED_WORKERS = 1; // Подготовка квалифицированных рабочих, служащих
|
||||||
|
case MIDDLE_LEVEL_SPECIALIST_TRAINING = 2; // Программа подготовки специалистов среднего звена
|
||||||
|
case BACHELOR = 3; // Бакалавриат
|
||||||
|
case MASTER = 4; // Магистратура
|
||||||
|
case SPECIALIST = 5; // Специалитет
|
||||||
|
case POSTGRADUATE = 6; // Аспирантура
|
||||||
|
case ADJUNCTURE = 7; // Адъюнктура
|
||||||
|
case RESIDENCY = 8; // Ординатура
|
||||||
|
case INTERNSHIP = 9; // Ассистентура - стажировка
|
||||||
|
case PROFESSIONAL_TRAINING = 10; // Профессиональная подготовка по профессиям рабочих, должностям служащих
|
||||||
|
case RETRAINING = 11; // Переподготовка рабочих, служащих
|
||||||
|
case ADVANCED_TRAINING = 12; // Повышение квалификации рабочих, служащих
|
||||||
|
case ADDITIONAL_GENERAL_DEVELOPMENT_PROGRAM = 13; // Дополнительная общеразвивающая программа
|
||||||
|
case ADDITIONAL_PREPROFESSIONAL_PROGRAM = 14; // Дополнительная предпрофессиональная программа
|
||||||
|
case ADDITIONAL_PREPROFESSIONAL_ART_PROGRAM = 15; // Дополнительная предпрофессиональная программа в сфере искусств
|
||||||
|
case PROFESSIONAL_ADVANCEMENT = 16; // Повышение квалификации
|
||||||
|
case PROFESSIONAL_RETRAINING = 17; // Профессиональная переподготовка
|
||||||
|
case PRESCHOOL_EDUCATION = 18; // Дошкольное образование
|
||||||
|
case PRIMARY_GENERAL_EDUCATION = 19; // Начальное общее образование
|
||||||
|
case BASIC_GENERAL_EDUCATION = 20; // Основное общее образование
|
||||||
|
case SECONDARY_GENERAL_EDUCATION = 21; // Среднее общее образование
|
||||||
|
case INTERNSHIP_PROGRAM = 22; // Интернатура
|
||||||
|
case ADDITIONAL_PREPROFESSIONAL_SPORT_PROGRAM = 23; // Дополнительная предпрофессиональная программа в сфере физической культуры и спорта
|
||||||
|
case BASIC_HIGHER_EDUCATION = 24; // Базовое высшее образование
|
||||||
|
case SPECIALIZED_HIGHER_EDUCATION = 25; // Специализированное высшее образование
|
||||||
|
|
||||||
|
|
||||||
|
public static function fromName(string $name): ?self {
|
||||||
|
return match ($name) {
|
||||||
|
'PREPARATION_OF_QUALIFIED_WORKERS' => self::PREPARATION_OF_QUALIFIED_WORKERS,
|
||||||
|
'MIDDLE_LEVEL_SPECIALIST_TRAINING' => self::MIDDLE_LEVEL_SPECIALIST_TRAINING,
|
||||||
|
'BACHELOR' => self::BACHELOR,
|
||||||
|
'MASTER' => self::MASTER,
|
||||||
|
'SPECIALIST' => self::SPECIALIST,
|
||||||
|
'POSTGRADUATE' => self::POSTGRADUATE,
|
||||||
|
'ADJUNCTURE' => self::ADJUNCTURE,
|
||||||
|
'RESIDENCY' => self::RESIDENCY,
|
||||||
|
'INTERNSHIP' => self::INTERNSHIP,
|
||||||
|
'PROFESSIONAL_TRAINING' => self::PROFESSIONAL_TRAINING,
|
||||||
|
'RETRAINING' => self::RETRAINING,
|
||||||
|
'ADVANCED_TRAINING' => self::ADVANCED_TRAINING,
|
||||||
|
'ADDITIONAL_GENERAL_DEVELOPMENT_PROGRAM' => self::ADDITIONAL_GENERAL_DEVELOPMENT_PROGRAM,
|
||||||
|
'ADDITIONAL_PREPROFESSIONAL_PROGRAM' => self::ADDITIONAL_PREPROFESSIONAL_PROGRAM,
|
||||||
|
'ADDITIONAL_PREPROFESSIONAL_ART_PROGRAM' => self::ADDITIONAL_PREPROFESSIONAL_ART_PROGRAM,
|
||||||
|
'PROFESSIONAL_ADVANCEMENT' => self::PROFESSIONAL_ADVANCEMENT,
|
||||||
|
'PROFESSIONAL_RETRAINING' => self::PROFESSIONAL_RETRAINING,
|
||||||
|
'PRESCHOOL_EDUCATION' => self::PRESCHOOL_EDUCATION,
|
||||||
|
'PRIMARY_GENERAL_EDUCATION' => self::PRIMARY_GENERAL_EDUCATION,
|
||||||
|
'BASIC_GENERAL_EDUCATION' => self::BASIC_GENERAL_EDUCATION,
|
||||||
|
'SECONDARY_GENERAL_EDUCATION' => self::SECONDARY_GENERAL_EDUCATION,
|
||||||
|
'INTERNSHIP_PROGRAM' => self::INTERNSHIP_PROGRAM,
|
||||||
|
'ADDITIONAL_PREPROFESSIONAL_SPORT_PROGRAM' => self::ADDITIONAL_PREPROFESSIONAL_SPORT_PROGRAM,
|
||||||
|
'BASIC_HIGHER_EDUCATION' => self::BASIC_HIGHER_EDUCATION,
|
||||||
|
'SPECIALIZED_HIGHER_EDUCATION' => self::SPECIALIZED_HIGHER_EDUCATION,
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PREPARATION_OF_QUALIFIED_WORKERS => 'Подготовка квалифицированных рабочих, служащих',
|
||||||
|
self::MIDDLE_LEVEL_SPECIALIST_TRAINING => 'Среднее профессиональное образование',
|
||||||
|
self::BACHELOR => 'Бакалавриат',
|
||||||
|
self::MASTER => 'Магистратура',
|
||||||
|
self::SPECIALIST => 'Специалитет',
|
||||||
|
self::POSTGRADUATE => 'Аспирантура',
|
||||||
|
self::ADJUNCTURE => 'Адъюнктура',
|
||||||
|
self::RESIDENCY => 'Ординатура',
|
||||||
|
self::INTERNSHIP => 'Ассистентура - стажировка',
|
||||||
|
self::PROFESSIONAL_TRAINING => 'Профессиональная подготовка по профессиям рабочих, должностям служащих',
|
||||||
|
self::RETRAINING => 'Переподготовка рабочих, служащих',
|
||||||
|
self::ADVANCED_TRAINING => 'Повышение квалификации рабочих, служащих',
|
||||||
|
self::ADDITIONAL_GENERAL_DEVELOPMENT_PROGRAM => 'Дополнительная общеразвивающая программа',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_PROGRAM => 'Дополнительная предпрофессиональная программа',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_ART_PROGRAM => 'Дополнительная предпрофессиональная программа в сфере искусств',
|
||||||
|
self::PROFESSIONAL_ADVANCEMENT => 'Повышение квалификации',
|
||||||
|
self::PROFESSIONAL_RETRAINING => 'Профессиональная переподготовка',
|
||||||
|
self::PRESCHOOL_EDUCATION => 'Дошкольное образование',
|
||||||
|
self::PRIMARY_GENERAL_EDUCATION => 'Начальное общее образование',
|
||||||
|
self::BASIC_GENERAL_EDUCATION => 'Основное общее образование',
|
||||||
|
self::SECONDARY_GENERAL_EDUCATION => 'Среднее общее образование',
|
||||||
|
self::INTERNSHIP_PROGRAM => 'Интернатура',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_SPORT_PROGRAM => 'Дополнительная предпрофессиональная программа в сфере физической культуры и спорта',
|
||||||
|
self::BASIC_HIGHER_EDUCATION => 'Базовое высшее образование',
|
||||||
|
self::SPECIALIZED_HIGHER_EDUCATION => 'Специализированное высшее образование',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::PREPARATION_OF_QUALIFIED_WORKERS => 'info',
|
||||||
|
self::MIDDLE_LEVEL_SPECIALIST_TRAINING => 'primary',
|
||||||
|
self::BACHELOR => 'success',
|
||||||
|
self::MASTER => 'success',
|
||||||
|
self::SPECIALIST => 'warning',
|
||||||
|
self::POSTGRADUATE => 'warning',
|
||||||
|
self::ADJUNCTURE => 'secondary',
|
||||||
|
self::RESIDENCY => 'secondary',
|
||||||
|
self::INTERNSHIP => 'light',
|
||||||
|
self::PROFESSIONAL_TRAINING => 'info',
|
||||||
|
self::RETRAINING => 'danger',
|
||||||
|
self::ADVANCED_TRAINING => 'success',
|
||||||
|
self::ADDITIONAL_GENERAL_DEVELOPMENT_PROGRAM => 'info',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_PROGRAM => 'info',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_ART_PROGRAM => 'info',
|
||||||
|
self::PROFESSIONAL_ADVANCEMENT => 'success',
|
||||||
|
self::PROFESSIONAL_RETRAINING => 'danger',
|
||||||
|
self::PRESCHOOL_EDUCATION => 'success',
|
||||||
|
self::PRIMARY_GENERAL_EDUCATION => 'success',
|
||||||
|
self::BASIC_GENERAL_EDUCATION => 'success',
|
||||||
|
self::SECONDARY_GENERAL_EDUCATION => 'success',
|
||||||
|
self::INTERNSHIP_PROGRAM => 'light',
|
||||||
|
self::ADDITIONAL_PREPROFESSIONAL_SPORT_PROGRAM => 'info',
|
||||||
|
self::BASIC_HIGHER_EDUCATION => 'success',
|
||||||
|
self::SPECIALIZED_HIGHER_EDUCATION => 'success',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use Filament\Support\Contracts\HasLabel;
|
||||||
|
use Filament\Support\Contracts\HasColor;
|
||||||
|
|
||||||
|
enum PostStatus: string implements HasLabel, HasColor
|
||||||
|
{
|
||||||
|
|
||||||
|
case VERIFICATION = 'verification';
|
||||||
|
case PUBLISHED = 'published';
|
||||||
|
case REJECTED = 'rejected';
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::VERIFICATION => 'На рассмотрении',
|
||||||
|
self::PUBLISHED => 'Опубликовано',
|
||||||
|
self::REJECTED => 'Отклонено',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getColor(): string|array|null
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::VERIFICATION => 'warning',
|
||||||
|
self::PUBLISHED => 'success',
|
||||||
|
self::REJECTED => 'gray',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
use Throwable;
|
||||||
|
use Inertia\Inertia;
|
||||||
|
|
||||||
|
class Handler extends ExceptionHandler
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* A list of exception types with their corresponding custom log levels.
|
||||||
|
*
|
||||||
|
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
|
||||||
|
*/
|
||||||
|
protected $levels = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of the exception types that are not reported.
|
||||||
|
*
|
||||||
|
* @var array<int, class-string<\Throwable>>
|
||||||
|
*/
|
||||||
|
protected $dontReport = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of the inputs that are never flashed to the session on validation exceptions.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $dontFlash = [
|
||||||
|
'current_password',
|
||||||
|
'password',
|
||||||
|
'password_confirmation',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the exception handling callbacks for the application.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
$this->reportable(function (Throwable $e) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare exception for rendering.
|
||||||
|
*
|
||||||
|
* @param \Throwable $e
|
||||||
|
* @return \Throwable
|
||||||
|
*/
|
||||||
|
public function render($request, Throwable $e)
|
||||||
|
{
|
||||||
|
$response = parent::render($request, $e);
|
||||||
|
|
||||||
|
if (! app()->environment(['local', 'testing']) && in_array($response->getStatusCode(), [500, 503, 404, 403])) {
|
||||||
|
return Inertia::render('Error', ['status' => $response->getStatusCode()])
|
||||||
|
->toResponse($request)
|
||||||
|
->setStatusCode($response->getStatusCode());
|
||||||
|
} elseif ($response->getStatusCode() === 419) {
|
||||||
|
return back()->with([
|
||||||
|
'message' => 'The page expired, please try again.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Facades;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
|
class ByteConverterFacade extends Facade
|
||||||
|
{
|
||||||
|
protected static function getFacadeAccessor()
|
||||||
|
{
|
||||||
|
return 'byteconverter';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\CustomForm\FormBuilderItem;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\Pages\ContentBuilderItem;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Components\Tab;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
use Symfony\Component\Finder\Finder;
|
||||||
|
|
||||||
|
class CustomFormForm
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function getForm(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->schema([
|
||||||
|
Tabs::make('Tabs')
|
||||||
|
->tabs([
|
||||||
|
Tabs\Tab::make('Основная информация')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('title')->label('Заголовок')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string|null $state, Forms\Set $set) {
|
||||||
|
$set('form_id', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('form_id')->label('ID формы')->unique(ignoreRecord: true)->required(),
|
||||||
|
]),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание формы')->required(),
|
||||||
|
Select::make('status')->label('Статус формы')->required()
|
||||||
|
->options(CustomFormStatus::class)
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Колонки')
|
||||||
|
->schema([
|
||||||
|
FormBuilderItem::getItem(),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Кнопка отправки')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('button')->label('Текст кнопки отправки')->required(),
|
||||||
|
Forms\Components\Textarea::make('send_message')->label('Текст после отправления письма')->required(),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Настройка интеграции с почтой')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('mail_settings')
|
||||||
|
->label('')
|
||||||
|
->addActionLabel('Добавить получателя')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('target')->label('Кому')->email()->required(),
|
||||||
|
TextInput::make('topic')->label('Тема')->required(),
|
||||||
|
Builder::make('data')->schema([
|
||||||
|
Builder\Block::make('text')->schema([
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('answers')->schema([]),
|
||||||
|
])->required(),
|
||||||
|
])->collapsed(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms\ItemForm\CustomForm;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\CustomForm\components\rules\RuleLengthLimitComponent;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\CustomForm\components\rules\RuleRequiredComponent;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\CustomForm\components\rules\RuleUniqueComponent;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class FormBuilderItem
|
||||||
|
{
|
||||||
|
public static function getItem()
|
||||||
|
{
|
||||||
|
return Builder::make('columns')
|
||||||
|
->schema([
|
||||||
|
Builder\Block::make('email')
|
||||||
|
->label('Почта')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
|
||||||
|
Section::make('Настройка')
|
||||||
|
->collapsed()
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
RuleUniqueComponent::getComponent(),
|
||||||
|
RuleLengthLimitComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('phone')
|
||||||
|
->label('Телефон')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
RuleUniqueComponent::getComponent(),
|
||||||
|
RuleLengthLimitComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('text')
|
||||||
|
->label('Короткий текст')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
RuleLengthLimitComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('textarea')
|
||||||
|
->label('Длинный текст текст')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
RuleLengthLimitComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('date')
|
||||||
|
->label('Дата')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
|
||||||
|
]),
|
||||||
|
Builder\Block::make('url')
|
||||||
|
->label('Ссылка')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
RuleUniqueComponent::getComponent(),
|
||||||
|
RuleLengthLimitComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('multiple_choice')
|
||||||
|
->label('Несколько вариантов')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(), Forms\Components\Repeater::make('columns')->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
])->collapsed(),
|
||||||
|
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('single_choice')
|
||||||
|
->label('Один вариант')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->label('Заголовок поля')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(), Forms\Components\Repeater::make('columns')->schema([
|
||||||
|
TextInput::make('title_field')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('name_field', Str::slug($state) . Carbon::now()->timestamp );
|
||||||
|
}),
|
||||||
|
Forms\Components\Hidden::make('name_field')->required(),
|
||||||
|
Forms\Components\Textarea::make('description')->label('Описание поля (опционально)'),
|
||||||
|
])->collapsed(),
|
||||||
|
|
||||||
|
Section::make('Настройка')
|
||||||
|
->statePath('rules')
|
||||||
|
->schema([
|
||||||
|
RuleRequiredComponent::getComponent(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->label('')
|
||||||
|
->addActionLabel('Добавить поле')
|
||||||
|
->collapsed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms\ItemForm\CustomForm\components\rules;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class RuleLengthLimitComponent
|
||||||
|
{
|
||||||
|
public static function getComponent() : Section
|
||||||
|
{
|
||||||
|
return Section::make('Ограничить количество символов в ответе')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
Forms\Components\TextInput::make('min')->label('От')->integer(),
|
||||||
|
Forms\Components\TextInput::make('max')->label('До')->integer()
|
||||||
|
]),
|
||||||
|
Forms\Components\Toggle::make('show_length')->label('Показывать максимальное количество символов под колонкой'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms\ItemForm\CustomForm\components\rules;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class RuleRequiredComponent
|
||||||
|
{
|
||||||
|
public static function getComponent() : Toggle
|
||||||
|
{
|
||||||
|
return Toggle::make('required')->label('Обязательное поле');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms\ItemForm\CustomForm\components\rules;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class RuleUniqueComponent
|
||||||
|
{
|
||||||
|
public static function getComponent() : Toggle
|
||||||
|
{
|
||||||
|
return Toggle::make('unique')->label('Уникальное поле');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,392 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms\ItemForm\Pages;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class ContentBuilderItem
|
||||||
|
{
|
||||||
|
public static function getItem()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
])->label('Текст'),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
Hidden::make('expansion')->required(),
|
||||||
|
Hidden::make('size')->required(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->getUploadedFileNameForStorageUsing(
|
||||||
|
fn (TemporaryUploadedFile $file): string =>
|
||||||
|
str(Str::slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME) . '-' . Carbon::now()->timestamp ) . '.' . $file->getClientOriginalExtension())
|
||||||
|
)
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->afterStateUpdated(function ($set, $state) {
|
||||||
|
$set('expansion', $state?->getClientOriginalExtension());
|
||||||
|
$set('size', ByteConverter::bytesToHuman($state?->getSize()));
|
||||||
|
})
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('tabs')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('tab')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
])->label('Текст'),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Слайдер изображений'),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
])->label('Список новостей'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Слайдер изображений'),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
])->label('Список новостей'),
|
||||||
|
Builder\Block::make('postItem')
|
||||||
|
->schema([
|
||||||
|
Select::make('post')
|
||||||
|
->options(Post::query()->where('status', PostStatus::PUBLISHED)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
])->label('Новость'),
|
||||||
|
Builder\Block::make('pageItem')
|
||||||
|
->schema([
|
||||||
|
Select::make('page')
|
||||||
|
->options(Page::query()->where('title', '!=' , null)->where('is_visible', true)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
])->label('Страница'),
|
||||||
|
Builder\Block::make('customForm')
|
||||||
|
->schema([
|
||||||
|
Select::make('form')
|
||||||
|
->options(CustomForm::query()->where('status', CustomFormStatus::PUBLISHED)->pluck('title', 'form_id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
])->label('Форма'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->blockPickerColumns(3)
|
||||||
|
->blockPickerWidth('2xl')
|
||||||
|
->addActionLabel('Добавить новый блок');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\Pages\ContentBuilderItem;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Components\Tab;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
use Symfony\Component\Finder\Finder;
|
||||||
|
|
||||||
|
class PageForm
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function getPageTemplates() {
|
||||||
|
|
||||||
|
$finder = new Finder();
|
||||||
|
$finder->files()->in('../resources/js/Pages/Client/BasePageTemplate');
|
||||||
|
|
||||||
|
|
||||||
|
$fileInfos = [];
|
||||||
|
foreach ($finder as $fileInfo) {
|
||||||
|
$fileInfos[] = [
|
||||||
|
'filename' => $fileInfo->getBasename('.' . $fileInfo->getExtension()),
|
||||||
|
|
||||||
|
'path' => preg_replace('/.*\/(Client\/.*)/', '$1', $fileInfo->getPath() . '/' . $fileInfo->getBasename('.' . $fileInfo->getExtension())),
|
||||||
|
'extension' => $fileInfo->getExtension(),
|
||||||
|
'size' => $fileInfo->getSize(),
|
||||||
|
'mtime' => $fileInfo->getMTime(),
|
||||||
|
'atime' => $fileInfo->getATime(),
|
||||||
|
'isReadable' => $fileInfo->isReadable(),
|
||||||
|
'isWritable' => $fileInfo->isWritable(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$fileInfos = collect($fileInfos);
|
||||||
|
return $fileInfos->pluck('filename', 'path');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getForm(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Tabs::make('')->schema([
|
||||||
|
Forms\Components\Tabs\Tab::make('Основная информация')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('title')->label('Заголовок')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
$set('path', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
$set('path', Str::slug($state));
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Select::make('sub_section_id')->label('Подраздел')
|
||||||
|
->relationship('section', 'title')
|
||||||
|
->createOptionForm([
|
||||||
|
Forms\Components\TextInput::make('title')->label('Название подраздела')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
|
||||||
|
]),
|
||||||
|
Select::make('code')->options([
|
||||||
|
'200' => 'Открытая страница',
|
||||||
|
'404' => 'Не найдено',
|
||||||
|
'500' => 'Ведутся технические работы',
|
||||||
|
])->label('Статус')->required()->default('200'),
|
||||||
|
Toggle::make('searchable')->default(true)->label('Индексируется поиском')->inline(false),
|
||||||
|
TextInput::make('search_data')->hidden(),
|
||||||
|
]),
|
||||||
|
Forms\Components\Tabs\Tab::make('Контент')->schema([
|
||||||
|
ContentBuilderItem::getItem()
|
||||||
|
]),
|
||||||
|
Forms\Components\Tabs\Tab::make('Настройки')->schema([
|
||||||
|
Select::make('template')->options(self::getPageTemplates())->required(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
|
||||||
|
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,440 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Components\Forms;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Components\Forms\ItemForm\Pages\ContentBuilderItem;
|
||||||
|
use App\Helpers\ByteConverter;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\SpatieTagsInput;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Components\Tab;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
use Symfony\Component\Finder\Finder;
|
||||||
|
|
||||||
|
class PostForm
|
||||||
|
{
|
||||||
|
public static function getForm(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->schema([
|
||||||
|
Tabs::make('Tabs')
|
||||||
|
->tabs([
|
||||||
|
Tabs\Tab::make('Основная информация')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('title')->label('Заголовок')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string|null $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
|
||||||
|
]),
|
||||||
|
Select::make('status')->options([
|
||||||
|
'verification' => 'На рассмотрении',
|
||||||
|
'published' => 'Одобрено',
|
||||||
|
'rejected' => 'Отказано',
|
||||||
|
])->label('Статус')->required()->default(PostStatus::VERIFICATION),
|
||||||
|
Select::make('category_id')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
->preload()
|
||||||
|
->label('Категория'),
|
||||||
|
SpatieTagsInput::make('tags')->label('Тэги'),
|
||||||
|
Forms\Components\TagsInput::make('authors')
|
||||||
|
->label('Авторы')->placeholder('Добавить автора'),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Содержание новости')
|
||||||
|
->schema([
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')->label('Текст')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')->label('Файлы')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')->label('Персона')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')->label('Этапы')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->live()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])
|
||||||
|
->itemLabel(fn (array $state): ?string => $state['title'] ?? null)
|
||||||
|
->minItems(1)
|
||||||
|
->collapsible()
|
||||||
|
->collapsed()
|
||||||
|
|
||||||
|
|
||||||
|
]),
|
||||||
|
Builder\Block::make('tabs')->label('Вкладки')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('tab')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
])->label('Текст'),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Слайдер изображений'),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
])->label('Список новостей'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')->label('Слайдер изображений')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')->label('Изображение')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('video')->label('Видео')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')->label('Список новостей')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postItem')->label('Новость')
|
||||||
|
->schema([
|
||||||
|
Select::make('post')
|
||||||
|
->options(Post::query()->where('status', PostStatus::PUBLISHED)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('pageItem')->label('Страница')
|
||||||
|
->schema([
|
||||||
|
Select::make('page')
|
||||||
|
->options(Page::query()->where('title', '!=' , null)->where('is_visible', true)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->blockPickerColumns(3)
|
||||||
|
->blockPickerWidth('2xl')
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Изображения')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('preview')->label('Превью новости')
|
||||||
|
->image()
|
||||||
|
->optimize('webp')
|
||||||
|
->resize(50)
|
||||||
|
->imageEditor()
|
||||||
|
->directory('images'),
|
||||||
|
FileUpload::make('images')->label('Альбом')
|
||||||
|
->image()
|
||||||
|
->optimize('jpg')
|
||||||
|
->resize(30)
|
||||||
|
->imageEditor()
|
||||||
|
->panelLayout('grid')
|
||||||
|
->reorderable()
|
||||||
|
->imageEditor()
|
||||||
|
->multiple()
|
||||||
|
->directory('images'),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Exports;
|
||||||
|
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\CustomFormResponse;
|
||||||
|
use Filament\Actions\Exports\ExportColumn;
|
||||||
|
use Filament\Actions\Exports\Exporter;
|
||||||
|
use Filament\Actions\Exports\Models\Export;
|
||||||
|
|
||||||
|
class CustomFormExporter extends Exporter
|
||||||
|
{
|
||||||
|
protected static ?string $model = CustomForm::class;
|
||||||
|
|
||||||
|
public static function getColumns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
ExportColumn::make('id'),
|
||||||
|
ExportColumn::make('title'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getCompletedNotificationBody(Export $export): string
|
||||||
|
{
|
||||||
|
$body = 'Your custom form export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
||||||
|
|
||||||
|
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||||
|
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AcademicJournalResource\Pages;
|
||||||
|
use App\Filament\Resources\AcademicJournalResource\RelationManagers;
|
||||||
|
use App\Filament\Resources\AcademicJournalResource\RelationManagers\JournalsRelationManager;
|
||||||
|
use App\Models\AcademicJournal;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class AcademicJournalResource extends Resource
|
||||||
|
{
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Наука';
|
||||||
|
|
||||||
|
public static ?string $label = 'Журнал';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Научные журналы';
|
||||||
|
|
||||||
|
protected static ?string $model = AcademicJournal::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-beaker';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Section::make()->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('title')->label('Заголовок')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string|null $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Tabs::make('Tabs')
|
||||||
|
->tabs([
|
||||||
|
Tabs\Tab::make('Основная информация журнала')
|
||||||
|
->schema([
|
||||||
|
Builder::make('main_info')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label('')
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение(-я)'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
Hidden::make('mime'),
|
||||||
|
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes(['video/mp4','video/ogg','video/webm'])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('videos')
|
||||||
|
->visibility('public')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Редакция')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Section::make('Главный редактор')->schema([
|
||||||
|
Forms\Components\Repeater::make('chief_editor')->schema([
|
||||||
|
TextInput::make('name')->label('Имя'),
|
||||||
|
TextInput::make('academicTitle')->label('Ученная степень'),
|
||||||
|
TextInput::make('position')->label('Должность'),
|
||||||
|
TextInput::make('institution')->label('Учереждение'),
|
||||||
|
])->maxItems(1),
|
||||||
|
]),
|
||||||
|
Forms\Components\Section::make('Редакторы')->schema([
|
||||||
|
Forms\Components\Repeater::make('editors')->schema([
|
||||||
|
TextInput::make('name')->label('Имя'),
|
||||||
|
TextInput::make('academicTitle')->label('Ученная степень'),
|
||||||
|
TextInput::make('position')->label('Должность'),
|
||||||
|
TextInput::make('institution')->label('Учереждение'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->collapsible()
|
||||||
|
->label('')
|
||||||
|
->addActionLabel('Добавить редактора'),
|
||||||
|
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Информация для авторов')
|
||||||
|
->schema([
|
||||||
|
Builder::make('for_authors')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label('')
|
||||||
|
->required()
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение(-я)'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
Hidden::make('mime'),
|
||||||
|
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes(['video/mp4','video/ogg','video/webm'])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('videos')
|
||||||
|
->visibility('public')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
]),
|
||||||
|
])->columnSpanFull()
|
||||||
|
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
JournalsRelationManager::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListAcademicJournals::route('/'),
|
||||||
|
'create' => Pages\CreateAcademicJournal::route('/create'),
|
||||||
|
'edit' => Pages\EditAcademicJournal::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AcademicJournalResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AcademicJournalResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateAcademicJournal extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AcademicJournalResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AcademicJournalResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AcademicJournalResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditAcademicJournal extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AcademicJournalResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AcademicJournalResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AcademicJournalResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListAcademicJournals extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = AcademicJournalResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AcademicJournalResource\RelationManagers;
|
||||||
|
|
||||||
|
use App\Models\AcademicJournal;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class JournalsRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'journals';
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->required(),
|
||||||
|
FileUpload::make('path_file')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public'),
|
||||||
|
Forms\Components\TextInput::make('year_publication')->integer(),
|
||||||
|
Toggle::make('is_active')->default(true)->label('Активный выпуск')->inline(false),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->defaultGroup('year_publication')
|
||||||
|
->reorderable('sort')
|
||||||
|
->defaultSort('sort')
|
||||||
|
->recordTitleAttribute('title')
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('title'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationCategoryResource\Pages;
|
||||||
|
use App\Filament\Resources\AdditionalEducationCategoryResource\RelationManagers;
|
||||||
|
use App\Models\AdditionalEducationCategory;
|
||||||
|
use App\Models\DirectionAdditionalEducation;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class AdditionalEducationCategoryResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = AdditionalEducationCategory::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
public static ?string $label = 'Категория';
|
||||||
|
protected static ?string $pluralLabel = 'Категории дополнительного образования';
|
||||||
|
protected static ?string $navigationParentItem = 'Дополнительное Образование';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make('2')->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->required(),
|
||||||
|
Forms\Components\Select::make('dir_addit_educat_id')->required()
|
||||||
|
->options(DirectionAdditionalEducation::where('is_active', true)->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
Forms\Components\Toggle::make('is_active')->columnSpanFull()->inline(false)->default(true),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListAdditionalEducationCategories::route('/'),
|
||||||
|
'create' => Pages\CreateAdditionalEducationCategory::route('/create'),
|
||||||
|
'edit' => Pages\EditAdditionalEducationCategory::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateAdditionalEducationCategory extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationCategoryResource::class;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditAdditionalEducationCategory extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationCategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListAdditionalEducationCategories extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationCategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,456 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\FormEducation;
|
||||||
|
use App\Enums\LevelEducational;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Resources\AdditionalEducationResource\Pages;
|
||||||
|
use App\Filament\Resources\AdditionalEducationResource\RelationManagers;
|
||||||
|
use App\Models\AdditionalEducation;
|
||||||
|
use App\Models\AdditionalEducationCategory;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\DirectionAdditionalEducation;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\SpatieTagsInput;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class AdditionalEducationResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = AdditionalEducation::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
public static ?string $label = 'Дополнительное образование';
|
||||||
|
protected static ?string $pluralLabel = 'Дополнительное образование';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-academic-cap';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Tabs::make('Tabs')
|
||||||
|
->tabs([
|
||||||
|
Tabs\Tab::make('Основная информация')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make('2')->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->required(),
|
||||||
|
Forms\Components\Select::make('category_id')->required()
|
||||||
|
->options(AdditionalEducationCategory::where('is_active', true)->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
Forms\Components\TextInput::make('target_group')->required()->columnSpanFull(),
|
||||||
|
Forms\Components\TextInput::make('qualification')->required()->columnSpanFull(),
|
||||||
|
Forms\Components\Grid::make('2')->schema([
|
||||||
|
Forms\Components\TextInput::make('price')->required()->integer(),
|
||||||
|
Forms\Components\TextInput::make('learning_time')->required()->integer(),
|
||||||
|
]),
|
||||||
|
Forms\Components\Select::make('form_education')->required()->options(FormEducation::class),
|
||||||
|
Forms\Components\Toggle::make('is_active')->columnSpanFull()->inline(false)->default(true),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Контент')
|
||||||
|
->schema([
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')->label('Текст')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')->label('Файлы')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')->label('Персона')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')->label('Этапы')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->live()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])
|
||||||
|
->itemLabel(fn (array $state): ?string => $state['title'] ?? null)
|
||||||
|
->minItems(1)
|
||||||
|
->collapsible()
|
||||||
|
->collapsed()
|
||||||
|
|
||||||
|
|
||||||
|
]),
|
||||||
|
Builder\Block::make('tabs')->label('Вкладки')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('tab')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
])->label('Текст'),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Слайдер изображений'),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
])->label('Список новостей'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')->label('Слайдер изображений')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')->label('Изображение')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('video')->label('Видео')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')->label('Список новостей')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postItem')->label('Новость')
|
||||||
|
->schema([
|
||||||
|
Select::make('post')
|
||||||
|
->options(Post::query()->where('status', PostStatus::PUBLISHED)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('pageItem')->label('Страница')
|
||||||
|
->schema([
|
||||||
|
Select::make('page')
|
||||||
|
->options(Page::query()->where('title', '!=' , null)->where('is_visible', true)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->blockPickerColumns(3)
|
||||||
|
->blockPickerWidth('2xl')
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListAdditionalEducation::route('/'),
|
||||||
|
'create' => Pages\CreateAdditionalEducation::route('/create'),
|
||||||
|
'edit' => Pages\EditAdditionalEducation::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateAdditionalEducation extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditAdditionalEducation extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListAdditionalEducation extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = AdditionalEducationResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\FormEducation;
|
||||||
|
use App\Enums\LevelEducational;
|
||||||
|
use App\Filament\Resources\AdmissionCampaignResource\Pages;
|
||||||
|
use App\Filament\Resources\AdmissionCampaignResource\RelationManagers;
|
||||||
|
use App\Models\AdmissionCampaign;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class AdmissionCampaignResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = AdmissionCampaign::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Приемная-компания';
|
||||||
|
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')->label('Название')->required()->columnSpanFull(),
|
||||||
|
Forms\Components\Select::make('academic_year')->label('Академический год')->required()
|
||||||
|
->options(['2024' => '2024/2025', '2025' => '2025/2026']),
|
||||||
|
Forms\Components\Select::make('status')->label('Статус')->required()
|
||||||
|
->options(['1' => 'Активный', '2' => 'Архивный', '3' => 'Скрыт']),
|
||||||
|
Forms\Components\Section::make()->schema([
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Select::make('edu_name')->options(LevelEducational::class),
|
||||||
|
])->columnSpanFull(),
|
||||||
|
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
Tables\Columns\TextColumn::make('academic_year'),
|
||||||
|
Tables\Columns\TextColumn::make('status'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListAdmissionCampaigns::route('/'),
|
||||||
|
'create' => Pages\CreateAdmissionCampaign::route('/create'),
|
||||||
|
'edit' => Pages\EditAdmissionCampaign::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionCampaignResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionCampaignResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateAdmissionCampaign extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionCampaignResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionCampaignResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionCampaignResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditAdmissionCampaign extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionCampaignResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionCampaignResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionCampaignResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListAdmissionCampaigns extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionCampaignResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\EducationalProgramStatus;
|
||||||
|
use App\Filament\Resources\AdmissionPlanResource\Pages;
|
||||||
|
use App\Filament\Resources\AdmissionPlanResource\RelationManagers;
|
||||||
|
use App\Filament\Resources\EducationalProgramResource\RelationManagers\AdmissionPlansRelationManager;
|
||||||
|
use App\Models\AdmissionCampaign;
|
||||||
|
use App\Models\AdmissionPlan;
|
||||||
|
use App\Models\EducationalProgram;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class AdmissionPlanResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = AdmissionPlan::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'План приема';
|
||||||
|
|
||||||
|
protected static ?string $navigationParentItem = 'Приемная-компания';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Select::make('educational_programs_id')
|
||||||
|
->searchable()
|
||||||
|
->label('Образовательная программа')
|
||||||
|
->options(EducationalProgram::whereIn('status', [EducationalProgramStatus::PUBLISHED, EducationalProgramStatus::IN_PROGRESS])->pluck('name', 'id')),
|
||||||
|
Forms\Components\Select::make('admission_campaigns_id')
|
||||||
|
->label('Приемная компания')
|
||||||
|
->options(AdmissionCampaign::all()->pluck('name', 'id')),
|
||||||
|
Section::make('План приема')->schema([
|
||||||
|
Forms\Components\Repeater::make('exams')->label('Вступительные испытания')->schema([
|
||||||
|
TextInput::make('title')->label('Название-предмета'),
|
||||||
|
Forms\Components\Select::make('type_exam')->label('Тип-ВИ')
|
||||||
|
->options(['ege' => 'ЕГЭ', 'internal_test' => 'ВИ, проводимое организацией самостоятельно']),
|
||||||
|
TextInput::make('min_score')->label('Минимальный-балл')->integer()
|
||||||
|
])->live()->maxItems(2)->collapsed()->addActionLabel('Добавить вступительное испытание')->columns(3) ->itemLabel(function (Get $get) {
|
||||||
|
static $count = 0;
|
||||||
|
$maxCount = count($get('exams'));
|
||||||
|
$count = ($count++ <= $maxCount) ? $count : 1;
|
||||||
|
return "Вступительное испытание #" . $count;
|
||||||
|
}),
|
||||||
|
Forms\Components\Repeater::make('contests')->label('Условия поступления')->schema([
|
||||||
|
Forms\Components\Select::make('form_education')->label('Форма образования')
|
||||||
|
->options(['och' => 'Очная форма обучения', 'zaoch' => 'Заочная форма обучения', 'och_zaoch' => 'Очно-заочная форма обучения']),
|
||||||
|
Forms\Components\Select::make('financing_source')->label('Источник финансирования')
|
||||||
|
->options(['budget' => 'Бюджетное место', 'non_budget' => 'С оплатой обучения']),
|
||||||
|
TextInput::make('budget_quantity_position')->label('Количество бюджетных мест')->integer(),
|
||||||
|
TextInput::make('non_budget_quantity_position')->label('Количество платных мест')->integer()
|
||||||
|
])->live()->maxItems(2)->collapsed()->addActionLabel('Добавить группу')->columns(3)
|
||||||
|
->itemLabel(function (Get $get) {
|
||||||
|
static $count = 0;
|
||||||
|
$maxCount = count($get('contests'));
|
||||||
|
$count = ($count++ <= $maxCount) ? $count : 1;
|
||||||
|
return "Группа #" . $count;
|
||||||
|
}),
|
||||||
|
|
||||||
|
]),
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListAdmissionPlans::route('/'),
|
||||||
|
'create' => Pages\CreateAdmissionPlan::route('/create'),
|
||||||
|
'edit' => Pages\EditAdmissionPlan::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionPlanResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionPlanResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateAdmissionPlan extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionPlanResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionPlanResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionPlanResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditAdmissionPlan extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionPlanResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\AdmissionPlanResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\AdmissionPlanResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListAdmissionPlans extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = AdmissionPlanResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CategoryResource\Pages;
|
||||||
|
use App\Filament\Resources\CategoryResource\RelationManagers;
|
||||||
|
use App\Models\Category;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class CategoryResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Category::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Новости и мероприятия';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Категории';
|
||||||
|
protected static ?string $navigationParentItem = 'Новости';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->required()->label('Название'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCategories::route('/'),
|
||||||
|
'create' => Pages\CreateCategory::route('/create'),
|
||||||
|
'edit' => Pages\EditCategory::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCategory extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CategoryResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCategory extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCategories extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\CustomFormStatus;
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Components\Forms\CustomFormForm;
|
||||||
|
use App\Filament\Exports\CustomFormExporter;
|
||||||
|
use App\Filament\Resources\CustomFormResource\Pages;
|
||||||
|
use App\Filament\Resources\CustomFormResource\RelationManagers;
|
||||||
|
use App\Filament\Resources\CustomFormResource\RelationManagers\ResponsesRelationManager;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\CustomForm;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\SpatieTagsInput;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
use PhpParser\Node\Stmt\Block;
|
||||||
|
|
||||||
|
class CustomFormResource extends Resource
|
||||||
|
{
|
||||||
|
|
||||||
|
public static ?string $label = 'Форма';
|
||||||
|
protected static ?string $pluralLabel = 'Пользовательские формы';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $model = CustomForm::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-squares-plus';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return CustomFormForm::getForm($form);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('title'),
|
||||||
|
Tables\Columns\TextColumn::make('form_id'),
|
||||||
|
Tables\Columns\TextColumn::make('status'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
ResponsesRelationManager::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCustomForms::route('/'),
|
||||||
|
'create' => Pages\CreateCustomForm::route('/create'),
|
||||||
|
'edit' => Pages\EditCustomForm::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCustomForm extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Exports\CustomFormExporter;
|
||||||
|
use App\Filament\Resources\CustomFormResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCustomForm extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasCombinedRelationManagerTabsWithContent(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Exports\CustomFormExporter;
|
||||||
|
use App\Filament\Resources\CustomFormResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCustomForms extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+226
@@ -0,0 +1,226 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResource\RelationManagers;
|
||||||
|
|
||||||
|
use App\Filament\Exports\CustomFormExporter;
|
||||||
|
use App\Models\CustomFormResponse;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Infolists\Components\Section;
|
||||||
|
use Filament\Infolists\Components\TextEntry;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Columns\ViewColumn;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use pxlrbt\FilamentExcel\Actions\Tables\ExportAction;
|
||||||
|
use pxlrbt\FilamentExcel\Actions\Tables\ExportBulkAction;
|
||||||
|
use pxlrbt\FilamentExcel\Columns\Column;
|
||||||
|
use pxlrbt\FilamentExcel\Exports\ExcelExport;
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'responses';
|
||||||
|
|
||||||
|
protected static ?string $title = 'Ответы на форму';
|
||||||
|
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema(self::formColumns());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function formColumns(): array
|
||||||
|
{
|
||||||
|
$columns = collect($this->ownerRecord->columns);
|
||||||
|
|
||||||
|
return $columns
|
||||||
|
->pluck('data.name_field', 'data.title_field')
|
||||||
|
->map(function ($name, $label) use ($columns) {
|
||||||
|
// Находим информацию о текущем поле по его имени
|
||||||
|
$columnInfo = $columns->firstWhere('data.name_field', $name);
|
||||||
|
|
||||||
|
// Проверяем тип поля
|
||||||
|
if ($columnInfo['type'] === 'multiple_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return [
|
||||||
|
$column['name_field'] => $column['title_field']
|
||||||
|
];
|
||||||
|
})->reduce(function ($carry, $item) {
|
||||||
|
return array_merge($carry, $item);
|
||||||
|
}, []);
|
||||||
|
return Forms\Components\CheckboxList::make('answers.' . $name)
|
||||||
|
->options($options)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($columnInfo['type'] === 'single_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return [
|
||||||
|
$column['name_field'] => $column['title_field']
|
||||||
|
];
|
||||||
|
})->reduce(function ($carry, $item) {
|
||||||
|
return array_merge($carry, $item);
|
||||||
|
}, []);
|
||||||
|
return Forms\Components\Radio::make('answers.' . $name)
|
||||||
|
->options($options)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Обработка других типов полей
|
||||||
|
return Forms\Components\TextInput::make('answers.' . $name)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
})
|
||||||
|
->values()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function infoListColumns(): array
|
||||||
|
{
|
||||||
|
$columns = collect($this->ownerRecord->columns);
|
||||||
|
|
||||||
|
return $columns
|
||||||
|
->pluck('data.name_field', 'data.title_field')
|
||||||
|
->map(function ($name, $label) use ($columns) {
|
||||||
|
// Находим информацию о текущем поле по его имени
|
||||||
|
$columnInfo = $columns->firstWhere('data.name_field', $name);
|
||||||
|
|
||||||
|
|
||||||
|
// Проверяем тип поля
|
||||||
|
if ($columnInfo['type'] === 'multiple_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return [
|
||||||
|
$column['name_field'] => $column['title_field']
|
||||||
|
];
|
||||||
|
})->reduce(function ($carry, $item) {
|
||||||
|
return array_merge($carry, $item);
|
||||||
|
}, []);
|
||||||
|
return TextEntry::make('answers.' . $name)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($columnInfo['type'] === 'single_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return $column['title_field'];
|
||||||
|
});
|
||||||
|
return TextEntry::make('answers.' . $name)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Обработка других типов полей
|
||||||
|
return TextEntry::make('answers.' . $name)
|
||||||
|
->label($label)
|
||||||
|
->columnSpanFull();
|
||||||
|
})
|
||||||
|
->values()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportColumns(): array
|
||||||
|
{
|
||||||
|
$columns = collect($this->ownerRecord->columns);
|
||||||
|
|
||||||
|
$columnObjects = $columns
|
||||||
|
->pluck('data.name_field', 'data.title_field')
|
||||||
|
->map(function ($name, $label) use ($columns) {
|
||||||
|
// Находим информацию о текущем поле по его имени
|
||||||
|
$columnInfo = $columns->firstWhere('data.name_field', $name);
|
||||||
|
// Проверяем тип поля
|
||||||
|
if ($columnInfo['type'] === 'multiple_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return [
|
||||||
|
$column['name_field'] => $column['title_field']
|
||||||
|
];
|
||||||
|
})->reduce(function ($carry, $item) {
|
||||||
|
return array_merge($carry, $item);
|
||||||
|
}, []);
|
||||||
|
return Column::make('answers.' . $name)->heading($label)
|
||||||
|
->formatStateUsing(function ($state) use ($options) {
|
||||||
|
return $options[$state];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($columnInfo['type'] === 'single_choice') {
|
||||||
|
$columnInfo = collect($columnInfo['data']['columns']);
|
||||||
|
$options = $columnInfo->map(function ($column) {
|
||||||
|
return [
|
||||||
|
$column['name_field'] => $column['title_field']
|
||||||
|
];
|
||||||
|
})->reduce(function ($carry, $item) {
|
||||||
|
return array_merge($carry, $item);
|
||||||
|
}, []);
|
||||||
|
return Column::make('answers.' . $name)->heading($label)
|
||||||
|
->formatStateUsing(function ($state) use ($options) {
|
||||||
|
return $options[$state];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Обработка других типов полей
|
||||||
|
return Column::make('answers.' . $name)->heading($label);
|
||||||
|
});
|
||||||
|
|
||||||
|
$columnObjects->prepend(Column::make('id')->heading('ID'));
|
||||||
|
$columnObjects->push(Column::make('created_at')->heading('Время создания'));
|
||||||
|
|
||||||
|
|
||||||
|
return $columnObjects->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Метод для получения опций для множественного выбора
|
||||||
|
|
||||||
|
public function tableColumns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Tables\Columns\TextColumn::make('id')->sortable(),
|
||||||
|
Tables\Columns\ToggleColumn::make('checked')->label('Просмотрено'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->defaultSort('created_at', 'desc')
|
||||||
|
->columns(self::tableColumns())
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
ExportAction::make()->exports([
|
||||||
|
ExcelExport::make()->withColumns(self::exportColumns()),
|
||||||
|
]),
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\ViewAction::make(),
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
ExportBulkAction::make()->exports([
|
||||||
|
ExcelExport::make()->withColumns(self::exportColumns())
|
||||||
|
->askForFilename()
|
||||||
|
->askForWriterType(),
|
||||||
|
]),
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource\Pages;
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource\RelationManagers;
|
||||||
|
use App\Models\CustomFormResponse;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class CustomFormResponseResource extends Resource
|
||||||
|
{
|
||||||
|
public static ?string $label = 'Форма';
|
||||||
|
protected static ?string $pluralLabel = 'Ответы на формы';
|
||||||
|
protected static ?string $navigationParentItem = 'Пользовательские Формы';
|
||||||
|
|
||||||
|
protected static ?string $model = CustomFormResponse::class;
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\ViewAction::make(),
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCustomFormResponses::route('/'),
|
||||||
|
'create' => Pages\CreateCustomFormResponse::route('/create'),
|
||||||
|
'edit' => Pages\EditCustomFormResponse::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResponseResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCustomFormResponse extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResponseResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResponseResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ViewRecord;
|
||||||
|
|
||||||
|
class CustomFormResponseView extends ViewRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResponseResource::class;
|
||||||
|
|
||||||
|
protected static string $view = 'filament.resources.posts.pages.view-post';
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResponseResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCustomFormResponse extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResponseResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomFormResponseResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CustomFormResponseResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCustomFormResponses extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CustomFormResponseResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DepartmentResource\Pages;
|
||||||
|
use App\Filament\Resources\DepartmentResource\RelationManagers;
|
||||||
|
use App\Models\Department;
|
||||||
|
use App\Models\Faculty;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class DepartmentResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Department::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Кафедры';
|
||||||
|
|
||||||
|
public static ?string $label = 'Кафедра';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $navigationParentItem = 'Факультеты';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')->label('Название кафедры')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
|
||||||
|
Forms\Components\Select::make('faculty_id')
|
||||||
|
->options(Faculty::all()->pluck('title', 'id'))
|
||||||
|
->label('Факультет')
|
||||||
|
->required(),
|
||||||
|
Toggle::make('is_active')->default(true)->label('Активная кафедра')->inline(false),
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('title')->label('Название'),
|
||||||
|
Tables\Columns\TextColumn::make('faculty.title')->label('Факультет')->words(2)
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\WorkersRelationManager::class,
|
||||||
|
RelationManagers\TeachersRelationManager::class,
|
||||||
|
RelationManagers\ProgramsRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListDepartments::route('/'),
|
||||||
|
'create' => Pages\CreateDepartment::route('/create'),
|
||||||
|
'edit' => Pages\EditDepartment::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DepartmentResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateDepartment extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DepartmentResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DepartmentResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditDepartment extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DepartmentResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasCombinedRelationManagerTabsWithContent(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DepartmentResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListDepartments extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = DepartmentResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\RelationManagers;
|
||||||
|
|
||||||
|
use App\Enums\EducationalProgramStatus;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Actions\AttachAction;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class ProgramsRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'programs';
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('name')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->recordTitleAttribute('name')
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
AttachAction::make()
|
||||||
|
->recordSelectOptionsQuery(fn (Builder $query) => $query->where('status', EducationalProgramStatus::PUBLISHED)),
|
||||||
|
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Actions\AttachAction;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class TeachersRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'teachers';
|
||||||
|
|
||||||
|
protected static ?string $inverseRelationship = 'departments_teach';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $title = 'Преподаватели кафедры';
|
||||||
|
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('name')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->recordTitleAttribute('name')
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
AttachAction::make()
|
||||||
|
->form(fn (AttachAction $action): array => [
|
||||||
|
$action->getRecordSelect(),
|
||||||
|
Forms\Components\TextInput::make('teaching_position')->label('Преподавательская должность')->required(),
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DepartmentResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Actions\AttachAction;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class WorkersRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'workers';
|
||||||
|
|
||||||
|
protected static ?string $inverseRelationship = 'departments_work';
|
||||||
|
|
||||||
|
protected static ?string $title = 'Сотрудники кафедры';
|
||||||
|
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('position')->label('Должность')->required(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->recordTitleAttribute('name')
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
Tables\Columns\TextColumn::make('position'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
AttachAction::make()
|
||||||
|
->form(fn (AttachAction $action): array => [
|
||||||
|
$action->getRecordSelect(),
|
||||||
|
Forms\Components\TextInput::make('position')->label('Должность')->required(),
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionAdditionalEducationResource\Pages;
|
||||||
|
use App\Filament\Resources\DirectionAdditionalEducationResource\RelationManagers;
|
||||||
|
use App\Models\DirectionAdditionalEducation;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class DirectionAdditionalEducationResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = DirectionAdditionalEducation::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
public static ?string $label = 'Направление';
|
||||||
|
protected static ?string $pluralLabel = 'Направления дополнительного образования';
|
||||||
|
protected static ?string $navigationParentItem = 'Дополнительное Образование';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->required()->columnSpanFull(),
|
||||||
|
Forms\Components\Toggle::make('is_active')->columnSpanFull()->inline(false)->default(true),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListDirectionAdditionalEducation::route('/'),
|
||||||
|
'create' => Pages\CreateDirectionAdditionalEducation::route('/create'),
|
||||||
|
'edit' => Pages\EditDirectionAdditionalEducation::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionAdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionAdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateDirectionAdditionalEducation extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionAdditionalEducationResource::class;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionAdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionAdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditDirectionAdditionalEducation extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionAdditionalEducationResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionAdditionalEducationResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionAdditionalEducationResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListDirectionAdditionalEducation extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionAdditionalEducationResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\LevelEducational;
|
||||||
|
use App\Filament\Resources\DirectionStudyResource\Pages;
|
||||||
|
use App\Filament\Resources\DirectionStudyResource\RelationManagers;
|
||||||
|
use App\Models\DirectionStudy;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class DirectionStudyResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = DirectionStudy::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Направление подготовки';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $navigationParentItem = 'Приемная-компания';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
//
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
Tables\Columns\TextColumn::make('code'),
|
||||||
|
Tables\Columns\TextColumn::make('lvl_edu')
|
||||||
|
->formatStateUsing(fn ($state) => $state->getLabel())
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListDirectionStudies::route('/'),
|
||||||
|
'create' => Pages\CreateDirectionStudy::route('/create'),
|
||||||
|
'edit' => Pages\EditDirectionStudy::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionStudyResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionStudyResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateDirectionStudy extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionStudyResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionStudyResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionStudyResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditDirectionStudy extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionStudyResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DirectionStudyResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DirectionStudyResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListDirectionStudies extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = DirectionStudyResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,453 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\PostStatus;
|
||||||
|
use App\Filament\Resources\DivisionResource\Pages;
|
||||||
|
use App\Filament\Resources\DivisionResource\RelationManagers;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\Division;
|
||||||
|
use App\Models\Page;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\Tabs;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class DivisionResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Division::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Структура института';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-squares-2x2';
|
||||||
|
|
||||||
|
public static ?string $label = 'Подразделение';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Подразделения института';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->schema([
|
||||||
|
Tabs::make('Tabs')
|
||||||
|
->tabs([
|
||||||
|
Tabs\Tab::make('Основная информация')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('title')->label('Заголовок')->required()
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string|null $state, Forms\Set $set) {
|
||||||
|
$set('slug', Str::slug($state));
|
||||||
|
}),
|
||||||
|
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
|
||||||
|
]),
|
||||||
|
Toggle::make('is_active')->default(true)->label('Активное подразделение')->inline(false),
|
||||||
|
]),
|
||||||
|
Tabs\Tab::make('Содержание')
|
||||||
|
->schema([
|
||||||
|
\Filament\Forms\Components\Builder::make('description')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')->label('Текст')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')->label('Файлы')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')->label('Персона')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')->label('Этапы')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->live()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])
|
||||||
|
->itemLabel(fn (array $state): ?string => $state['title'] ?? null)
|
||||||
|
->minItems(1)
|
||||||
|
->collapsible()
|
||||||
|
->collapsed()
|
||||||
|
|
||||||
|
|
||||||
|
]),
|
||||||
|
Builder\Block::make('tabs')->label('Вкладки')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('tab')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label(''),
|
||||||
|
])->label('Текст'),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Repeater::make('file')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('person')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')
|
||||||
|
->label('Имя')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
FileUpload::make('photo')
|
||||||
|
->label('Фотография')
|
||||||
|
->image()
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor(),
|
||||||
|
Forms\Components\Repeater::make('info')->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('column')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('content')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('stepper')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('step_name')
|
||||||
|
->label('Название шага')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\Repeater::make('steps')->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)->columnSpanFull(),
|
||||||
|
RichEditor::make('content')->required(),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Слайдер изображений'),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
])->label('Список новостей'),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
])->minItems(1),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('images')->label('Слайдер изображений')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')->label('Изображение')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
]),
|
||||||
|
Builder\Block::make('video')->label('Видео')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('mime')->readOnly(),
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'video/mp4',
|
||||||
|
'video/quicktime',
|
||||||
|
'video/x-msvideo',
|
||||||
|
'video/x-ms-wmv',
|
||||||
|
'video/avi',
|
||||||
|
'video/webm',
|
||||||
|
'video/ogg',
|
||||||
|
'video/3gpp',
|
||||||
|
'video/3gpp2',
|
||||||
|
'video/x-m4v',
|
||||||
|
])
|
||||||
|
->disk('public')
|
||||||
|
->directory('videos')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postsList')->label('Список новостей')
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
TextInput::make('count')
|
||||||
|
->label('Количество запией')
|
||||||
|
->integer(),
|
||||||
|
Select::make('category')
|
||||||
|
->options(Category::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('postItem')->label('Новость')
|
||||||
|
->schema([
|
||||||
|
Select::make('post')
|
||||||
|
->options(Post::query()->where('status', PostStatus::PUBLISHED)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('pageItem')->label('Страница')
|
||||||
|
->schema([
|
||||||
|
Select::make('page')
|
||||||
|
->options(Page::query()->where('title', '!=' , null)->where('is_visible', true)->pluck('title', 'id'))
|
||||||
|
->searchable()
|
||||||
|
->required(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->blockPickerColumns(3)
|
||||||
|
->blockPickerWidth('2xl')
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('title'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\WorkersRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListDivisions::route('/'),
|
||||||
|
'create' => Pages\CreateDivision::route('/create'),
|
||||||
|
'edit' => Pages\EditDivision::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DivisionResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DivisionResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateDivision extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DivisionResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DivisionResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DivisionResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditDivision extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DivisionResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasCombinedRelationManagerTabsWithContent(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DivisionResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DivisionResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListDivisions extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = DivisionResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DivisionResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Actions\AttachAction;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class WorkersRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'workers';
|
||||||
|
|
||||||
|
protected static ?string $title = 'Сотрудники';
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->recordTitleAttribute('name')
|
||||||
|
->reorderable('sort')
|
||||||
|
->defaultSort('sort')
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
Tables\Columns\TextColumn::make('administrativePosition'),
|
||||||
|
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
AttachAction::make()
|
||||||
|
->preloadRecordSelect()
|
||||||
|
->form(fn (AttachAction $action): array => [
|
||||||
|
$action->getRecordSelect(),
|
||||||
|
Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(),
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DetachAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalGroupResource\Pages;
|
||||||
|
use App\Filament\Resources\EducationalGroupResource\RelationManagers;
|
||||||
|
use App\Models\EducationalGroup;
|
||||||
|
use App\Models\Faculty;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class EducationalGroupResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $navigationGroup = 'Расписание и группы';
|
||||||
|
|
||||||
|
protected static ?string $model = EducationalGroup::class;
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Группы';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-user-group';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\Grid::make(2)->schema([
|
||||||
|
Forms\Components\TextInput::make('title')->label('Название группы')->required(),
|
||||||
|
Forms\Components\Select::make('faculty_id')->label('Факультет')->required()
|
||||||
|
->options(Faculty::all()->pluck('title', 'id'))
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('id')->label('ID'),
|
||||||
|
Tables\Columns\TextColumn::make('title')->label('Название'),
|
||||||
|
Tables\Columns\TextColumn::make('faculty.title')->label('Факультет'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListEducationalGroups::route('/'),
|
||||||
|
'create' => Pages\CreateEducationalGroup::route('/create'),
|
||||||
|
'edit' => Pages\EditEducationalGroup::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\EducationalGroupResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalGroupResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateEducationalGroup extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EducationalGroupResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\EducationalGroupResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalGroupResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditEducationalGroup extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EducationalGroupResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\EducationalGroupResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalGroupResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListEducationalGroups extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = EducationalGroupResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Enums\EducationalProgramStatus;
|
||||||
|
use App\Enums\LevelEducational;
|
||||||
|
use App\Filament\Resources\EducationalProgramResource\Pages;
|
||||||
|
use App\Filament\Resources\EducationalProgramResource\RelationManagers;
|
||||||
|
use App\Filament\Resources\EducationalProgramResource\RelationManagers\AdmissionPlansRelationManager;
|
||||||
|
use App\Models\Category;
|
||||||
|
use App\Models\EducationalProgram;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\Builder;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
|
use Filament\Forms\Components\RichEditor;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\SpatieTagsInput;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
|
class EducationalProgramResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = EducationalProgram::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Образование';
|
||||||
|
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Образовательные программы';
|
||||||
|
|
||||||
|
protected static ?string $navigationParentItem = 'Приемная-компания';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->schema([
|
||||||
|
TextInput::make('name')->label('Название')->required(),
|
||||||
|
Section::make('О программе')->schema([
|
||||||
|
Builder::make('about_program')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label('')
|
||||||
|
->required()
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение(-я)'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
Hidden::make('mime'),
|
||||||
|
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes(['video/mp4','video/ogg','video/webm'])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('videos')
|
||||||
|
->visibility('public')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
|
||||||
|
]),
|
||||||
|
Section::make('Особенности программы')->schema([
|
||||||
|
Builder::make('program_features')->label('')->blocks([
|
||||||
|
Builder\Block::make('heading')->label('Заголовок')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
||||||
|
TextInput::make('content')
|
||||||
|
->label('')
|
||||||
|
->live(onBlur: true)
|
||||||
|
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('paragraph')
|
||||||
|
->schema([
|
||||||
|
RichEditor::make('content')
|
||||||
|
->toolbarButtons([
|
||||||
|
'blockquote',
|
||||||
|
'bold',
|
||||||
|
'bulletList',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'orderedList',
|
||||||
|
'redo',
|
||||||
|
'strike',
|
||||||
|
'underline',
|
||||||
|
'undo',
|
||||||
|
])
|
||||||
|
->label('')
|
||||||
|
->required()
|
||||||
|
]),
|
||||||
|
Builder\Block::make('image')
|
||||||
|
->schema([
|
||||||
|
FileUpload::make('url')
|
||||||
|
->label('Изображение(-я)')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->reorderable()
|
||||||
|
->maxFiles(5)
|
||||||
|
->disk('public')
|
||||||
|
->directory('images')
|
||||||
|
->imageEditor()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('alt')
|
||||||
|
->label('Описание')
|
||||||
|
->placeholder('Необязяательно')
|
||||||
|
])->label('Изображение(-я)'),
|
||||||
|
Builder\Block::make('video')
|
||||||
|
->schema([
|
||||||
|
Hidden::make('mime'),
|
||||||
|
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes(['video/mp4','video/ogg','video/webm'])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('videos')
|
||||||
|
->visibility('public')
|
||||||
|
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
||||||
|
]),
|
||||||
|
Builder\Block::make('files')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->required()
|
||||||
|
->maxLength(255)
|
||||||
|
->autofocus(),
|
||||||
|
FileUpload::make('path')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/pdf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/zip'
|
||||||
|
])
|
||||||
|
->maxSize(512000)
|
||||||
|
->disk('public')
|
||||||
|
->directory('files')
|
||||||
|
->downloadable()
|
||||||
|
->visibility('public')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
->collapsed()
|
||||||
|
->blockNumbers(false)
|
||||||
|
->collapsible()
|
||||||
|
->addActionLabel('Добавить новый блок'),
|
||||||
|
|
||||||
|
]),
|
||||||
|
|
||||||
|
Select::make('lvl_edu')->options(LevelEducational::class)->label('Уровень образования')->required(),
|
||||||
|
Select::make('status')
|
||||||
|
->options(EducationalProgramStatus::class)
|
||||||
|
->label('Статус программы')->required(),
|
||||||
|
TextInput::make('lang_stud')->label('На каком языке ведется образование')->required(),
|
||||||
|
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('name'),
|
||||||
|
Tables\Columns\TextColumn::make('code_napr'),
|
||||||
|
Tables\Columns\TextColumn::make('directionStudy.lvl_edu')->limit(30),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AdmissionPlansRelationManager::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListEducationalPrograms::route('/'),
|
||||||
|
'create' => Pages\CreateEducationalProgram::route('/create'),
|
||||||
|
'edit' => Pages\EditEducationalProgram::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\EducationalProgramResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalProgramResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateEducationalProgram extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EducationalProgramResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\EducationalProgramResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\EducationalProgramResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditEducationalProgram extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EducationalProgramResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user