Download the PHP package webid/druid without Composer

On this page you can find all versions of the php package webid/druid. 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 druid

Dru^ID CMS

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

What is Dru^ID CMS?

Dru^ID is meant to be a light Content Management System build on top of a Laravel application. You can install it in an existing Laravel project without breaking everything or start with a fresh installation. This is more a toolbox for developers rather than a one click install CMS with a billion themes and plugins.

Essentially out of the box you'll get a Filament based admin panel where you can edit.

You'll also find helpers and services to manage multilingual and navigation menu features in your codebase.

Requirements

Installation

:warning: In order to install Dru^ID CMS, you first need to have a Laravel Filament running installation with the Filament Curator admin.

Please follow the installation process

Create a first admin

https://filamentphp.com/docs/3.x/panels/installation

Open the app/Providers/Filament/AdminPanelProvider.php file and add the following code after $panel->default()->id('admin')

Customize the config/cms.php file specially if you need to enable the multilingual feature. It's better to choose the default language before writing content.

Load the demo dataset

If you want to seed a demo dataset, simply run the following command in a fresh installation

php artisan druid:demo

The admin panel

Dru^ID has been built on top of the Filament package which means than by default, you'll find the administration panel to hte /admin route.

The Filament documentation will help you create your first admin if you're not already using it inside your project.

Once you're logged-in, you can create navigation menus, pages, posts, categories and reusable components.

Pages and posts

Pages and posts contents are based on a bunch of components such as Text, Text + Image, Separator, Quote etc. Some of them are included in the Dru^ID package itself, but you can easily create your own components using the Filament fields system.

Reusable components

When you need to display the exact same component in several contents for example a Call to action component, you can configure it one time and use it multiple times wherever you like afterward. This is what we call a reusable component.

Navigation menus

You can manually group and nest your contents inside navigation menus in the admin panel. You can choose between internal content (page and posts) and external URLs. You can nest your menu items up to 3 levels for advanced menus usage.

Druid Facade

Multilingual helpers

Function Description
Druid::isMultilingualEnabled(): bool Returns true if enable_multilingual_feature is set to true in config/cms.php
Druid::getDefaultLocale() : Langs Return the default Lang Enum set in config/cms.php
Druid::getDefaultLocaleKey() : string Same as previous but returns the local key
Druid::getLocales() : array Returns an array of locale data defined in config/cms.php
Druid::getCurrentLocale() : Lang Returns the current Lang chosen by the visitor
Druid::getLanaguageSwitcher() : Collection Returns a Collection of links in different languages to switch to

Navigation menus helpers

Function Description
Druid::getNavigationMenuBySlug(string $slug): Menu Returns a Menu DTO with all the nested links details
Druid::getNavigationMenuBySlugAndLang(string $slug, Langs $lang) : Menu Same as preview but with a given language

Settings helpers

Function Description
Druid::getSettingByKey(string $key): mixed Returns the value of a setting defined in the admin panel
Druid::getSettings(): Collection Returns a collection of all settings defined in the admin panel
Druid::isSettingsPageEnabled(): bool Returns true if the settings page is enabled
Druid::settingsPage(): SettingsInterface Returns the settings page class used to build the form

Services

NavigationMenuManager

When you have configured your navigation menus in the admin panel, you can have access to it using the Webid\Druid\Services\NavigationMenuManager\NavigationMenuManager class as a dependency or using the navigation menu helpers described in the Helpers section.

Once you have your menu manager instance, you can request a menu by slug and lang using the following method.

$mainMenu = $menuManager->getBySlug('main');

If you use the multilingual feature, you can have the same menu slug for several language so you can use the getCurrentLocale() helper function to dynamize the method call.

$mainMenuInCurrentLanguage = $menuManager->getBySlugAndLang('main', getCurrentLocale());

Language switcher

When using the multilingual feature, you certainly need to display a language switcher component that helps redirecting users to the equivalent content in another language (only if this equivalent exists).

For that you can use the Webid\Druid\Services\LanguageSwitcher class as a dependency or use the getLanaguageSwitcher() helper described in the helpers section.

You'll get a collection of langs details with the current URL equivalent in other languages and a key to indicate the current language.

Rendering & Templating

Dru^ID enable by default a bunch of front-end routes to help you save some time

By default, these view are rendered with a basic Blade template that you can override in your project resources/views/vendor/druid directory You can also choose to render a JsonResource instead by changing the views.type param in the config/cms.php file.

Creating new component types

  1. Create a class that implements the Webid\Druid\Components\ComponentInterface interface.
  2. Add all methods required by the interface.
  3. Register your component in the config/cms.php config file.

You can of course create a custom package that adds one or several components and give it to the community.

Extending default settings and Page/Post fields

Anywhere in your app (in a Service Provider, Middleware for example), you can override the default admin behaviour in terms of form fields

The following example will show you how to add an extra settings field

Tips to define a default homepage

We decide to not provide a default homepage route in the package because we think that it's better to let the developer choose the way to define it. Here is a simple way to define a default homepage route in your routes/web.php file.

You can use the Settings model to store the homepage id and retrieve it in your controller.

Scheduled Commands

Dru^ID comes with a scheduled command that check if articles have status scheduled_published and publish them if the publication date is reached.

To enable this feature, you need to add a schedule for this command :

Laravel 11 doc to add command to scheduler : https://laravel.com/docs/11.x/scheduling#defining-schedules

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of druid with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
webmozart/assert Version ^1.11
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 webid/druid contains the following files

Loading the files please wait ....