Craftable comes with handy Installer which make the installation like a breeze. You can install Craftable either on existing project or easily create a new one.
Craftable requires:
Craftable uses Laravel so you should check out its requirements too. It is compatible with Laravel 9 and Laravel 10:
By default Craftable uses Docker for its installation. You should checkout out Laravel Sail for more information. If you don't want to use Docker/Sail, use --no-sail
flag as
described in the New Craftable project section.)
The easiest way of installing Craftable is using Craftable Installer, which takes care of everything. Let's install the Installer globally:
composer global require "brackets/craftable-installer"
You can create a new Craftable project using:
craftable new my_project
that will create a new directory my_project
. Then go to this directory and install the craftable:
cd my_project
craftable install
{info} By default, Craftable Installer will use Laravel Sail. Therefore, instead of
php artisan
you should usesail artisan
, instead ofnpm install
rathersail npm install
, etc. If you don't want to use Laravel Sail use--no-sail
flag. In this case, you must have correctly configured.env
file and also have tools likecomposer
,npm
,php
globally available on your system.
The install
command is going to setup everything (install all dependencies, publish all important vendor configs, migrate the database, setup some configuration files, updates webpack configuration).
Command is going to generate and print the password for the default administrator account. Save this password to your clipboard, we are going to need it soon.
You may want to install Craftable to your existing Laravel application. Couldn't be easier.
In your project directory run:
craftable install
{info} By default, Craftable Installer will use Laravel Sail. Therefore, instead of
php artisan
you should usesail artisan
, instead ofnpm install
rathersail npm install
, etc. If you don't want to use Laravel Sail use--no-sail
flag. In this case, you must have correctly configured.env
file and also have tools likecomposer
,npm
,php
globally available on your system.
The install
command is going to setup everything (install all dependencies, publish all important vendor configs, migrate the database, setup some configuration files, updates webpack configuration).
Command is going to generate and print the password for the default administrator account. Save this password to your clipboard, we are going to need it soon.
If you can't use or prefer not to use Craftable Installer you can install Craftable to existing project manually (if you want to crate a new project, create new Laravel project before).
If you are using Laravel >= 9, please make sure that you have downgraded psr/simple-cache to version 2.0 before requiring brackets/craftable:
composer require psr/simple-cache:^2.0 maatwebsite/excel
In your Laravel project run following commands:
composer require brackets/craftable
composer require --dev brackets/admin-generator
# here, make sure .env variables are correctly configured
php artisan craftable:install
Finally we need to compile all the assets using npm. If you are using Laravel with Webpack, you need to run:
npm install && npm run dev
If you are using Laravel with Vite, Craftable will add Webpack for admin assets generation. To compile Craftable assets, you need to run:
npm install && npm run craftable-dev
{info} With Laravel's integration of Vite, the package.json setting
"type": "module"
was added to support specific Vite plugins, yet it's incompatible with Laravel Mix, which is used by Craftable. Our installation process removes this setting frompackage.json
, ensuring a smooth compilation for both Vite and Laravel Mix, but be mindful of potential issues arising from this change. For example, if you use Laravel Breeze, you may run into problems with its assets compilation. In this case renamingpostcss.config.js
topostcss.config.mjs
should do the trick.
Once installed, navigate your browser to /admin/login
. You should be able to see a login screen.
Use these credentials to log in:
administrator@brackets.sk
After authorization you should be able to see a default homepage and two menu items: