Download the PHP package enrisezwolle/filament-prefab without Composer

On this page you can find all versions of the php package enrisezwolle/filament-prefab. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-prefab

Prefab

Use this template to scaffold a new website

Installation

  1. Create a new project laravel new project-name
  2. clone this repository
  3. update the composer.json of your new project and change minimum stability to dev: "minimum-stability": "dev",
  4. composer require enrisezwolle/filament-prefab
  5. Install all modules:
    • php artisan prefab:filament --module=base --force
    • be patient with the shell script, force is required to overwrite the user model
    • php artisan prefab:filament --module=blog
    • php artisan prefab:filament --module=news
    • php artisan prefab:filament --module=story
    • php artisan prefab:filament --module=employee
    • php artisan prefab:filament --module=form-builder
    • php artisan prefab:filament --module=service
    • php artisan prefab:filament --module=location
    • php artisan prefab:filament --module=vacancy
    • php artisan prefab:filament --module=job-alert
    • php artisan prefab:filament --module=socials
    • NOTE: When updating modules after their initial rollout add --force to override local files. Additionally --no-shell can be added to prevent shell commands from being executed to speed up rolling out updates.
  6. composer dump
  7. php artisan migrate
  8. Create a user php artisan make:filament-user and follow the prompts
  9. php artisan db:seed
  10. open docker-compose.yml and replace the container_name with a name of this project
  11. docker compose up -d
  12. npm install && npm run dev

How to use search

  1. Add the IsSearchable interface to the model
  2. Implement the required methods. Your IDE will inform you when adding the interface.
  3. Add the use Searchable trait to the model
  4. Add the config to searchable.php config by adding it to the models array where the key is the model and the value is an array with the searchable columns
  5. Modules can also be specified in the modules section in searchable.php. Here the key is the relation name and the value an array of searchable fields. To search a module on a model add the name of the resource to the model array like you would add a column
  6. In the example below the page searches in the columns name and content, as well as the module heroImage, for which the columns title and content are searchable

Elasticsearch

The search module makes use of elasticsearch, please make sure SCOUT_DRIVER is set to elastic in your .env

To sync models to elastic run php artisan search:sync.

This project also contains a docker file which can be executed using laravel sail. The default port for elastic in this docker file is 9298. To allow your local project to communicate with this docker file add ELASTIC_HOST=localhost:9298 to your .env

How to use Hero Images

  1. add the use Heroable trait to the model
  2. add static::$model::heroableFields(), to the form fields in the resource

How to use Employees

  1. add the use Employeeable trait to the model
  2. add static::$model::employeeableFields(), to the form fields in the resource

How to use Seoable en Ogable

  1. add the use Seoabletrait to the model
  2. add static::$model::seoFields(), to the form fields in the resource

How to use Labels

  1. add the use Labelable trait to the model
  2. add static::$model::labelableFields(), to the form fields in the resource

How to use menus

  1. Implement App/Contracts/Menuable on models that should be able to be linked in menus.
  2. Implement required methods
  3. Available resources will be auto detected by the menu item resource

How to use icon picker

  1. create a folder in /resources/images/svg (if this folder is empty it will not be committed, so add atleast 1 icon)
  2. Place all the SVGs voor de icons you want in this folder (make sure the name of the file is prefixed with icon-)
  3. add the IconPicker to a resource (with preload):

  4. in the blade use <x-icon :name="$model->icon" /> to get the icon

How to use titles and slugs

  1. For titles and slugs we use a forked and self-hosted project filament-title-with-slug
  2. On forms use the TitleWithSlugInput form component. This will handle both the title and the slug. Both fields are required and the slug field validates if it is unique.
  3. For more documentation checkout the motivo repository

How to use blocks module

  1. Simple add BlockModule::make('content') to any resource, where the param is the name of the column which stores the data.
  2. Add 'content' => 'array' to the casts of the model
  3. New blocks can be created by making a new class in the App/Filament/Plugins/Blocks directory and extending the BaseBlock model
  4. New blocks can be registered in the active array in the blocks.php config file
  5. There is also a toggle content field, which can have nested fields. These are registed in the toggle_content array in the blocks.php config
  6. You can also create your own set of blocks.
    1. First create a new array in the blocks.php config file. The key of this array is not restricted.
    2. When adding the block module to the resource you can specify a second parameter, which is the key of the array from the previous step, for example BlockModule::make('content', 'form-builder')

How to use form module

  1. The form module is build on top of the blocks module
  2. Adding a new form can be done by creating a new form block, extending the FormBlock class
  3. Blocks can be registered in the form array in the blocks.php config file.

Front-end

  1. visit /blog for a blog overview
  2. visit /blog/{blog:slug} for the show page of a blog

Settings

  1. For settings we use the spatie plugin.
  2. Optional: add the filament page to the correct navigation group protected static ?string $navigationGroup = 'settings';
  3. Add the settings to view composer in AppServiceProvider to access variables in blade

Generating a sitemap

  1. When wanting to generate a sitemap, you need to add de model to the sitemap config file under key "models"
  2. The model must have a getRoute() function where the route is defined
  3. When all models are added, run the "app:generate-sitemap" command in the terminal

Biggest Todos:

"Copypaste" Todos:

dependencies:


All versions of filament-prefab with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
illuminate/filesystem Version ^11.0
illuminate/support Version ^11.0
illuminate/validation Version ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enrisezwolle/filament-prefab contains the following files

Loading the files please wait ....