dejwcake / craftable
Administration toolkit for Laravel - starting point for developing administration interface
Fund package maintenance!
BRACKETS-by-TRIAD
Requires
- php: ^8.2
- dejwcake/admin-auth: ^1.0
- dejwcake/admin-listing: ^1.0
- dejwcake/admin-translations: ^1.0
- dejwcake/admin-ui: ^1.0
- dejwcake/advanced-logger: ^1.1
- dejwcake/craftable-media: ^1.0
- dejwcake/craftable-translatable: ^1.0
- illuminate/support: ^12.0
- maatwebsite/excel: ^3.1
- spatie/laravel-backup: ^9.2.7
- spatie/laravel-permission: ^6.15
Requires (Dev)
- larastan/larastan: ^3.1
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5.9
README
About
Hi Crafter, welcome to the official documentation for Craftable - a Laravel-based open-source toolkit for building administration interfaces. It's an administration area minimalistic template. A starting point for developing back-office systems, intranets or a CMS systems.
This package is forked from BRACKETS-by-TRIAD/craftable and continuously maintained.
You could call it CMS, but it's a very slim one, with as little content to manage as possible. It has:
- UI - nice admin template based on CoreUI (http://coreui.io/)
- CRUD generator
- Authorization, My profile & Users CRUD
- Translations manager
- other helpers to quickly bootstrap your new administration area (Media Library, Admin Listing, etc.)
Demo
We have created a demo for you to play around at https://demo.getcraftable.com.
Use these credentials to sign-in:
- email:
demo@getcraftable.com
- password:
demo123
You can see an administration of:
- Posts - this is the standard CRUD generated with
admin-generator
package - Translatable Articles - this is the showcase for
translatable
eloquent models - Manage access - is a extended CRUD for the User (your existing eloquent model) management
- Translations - where you can manage the translations stored in the database
Made of components
Our intent was to split all the stuff into several packages with as least dependencies as possible. This is what we're coming with at the moment:
- Admin UI - admin template (CoreUI assets, blades, Vue)
- Admin Generator - CRUD generator for Eloquent models
- Admin Authentication - ability to authenticate into Admin area
- Translatable - ability to have translatable content (extending Laravel's default Localization)
- Admin Listing - ability to quickly build a query for administration listing for your Eloquent models
- Media Library - ability to attach media to eloquent models
- Admin Translations - translation manager (with UI)
Craftable uses all the packages above. It also uses some other 3rd party packages (like Spatie's spatie/laravel-permission
) and provides some basic default configuration to speed up a development of a typical administration interface.
Requirements
Craftable requires:
- PHP 8.2+
- Supported databases:
- MariaDb 11.6+
- PostgreSQL 17+
- npm 5.3+
- node 8.4+
Craftable uses Laravel so you should check out its requirements too. It is compatible with Laravel 12:
Installation
New Craftable project
First you need to have laravel application, so follow the Laravel installation guide: https://laravel.com/docs/12.x/installation
Create an empty database of your choice (PostgreSQL or MySQL).
Now you require these two main packages:
composer require dejwcake/craftable composer require --dev dejwcake/admin-generator
Add Craftable to existing project
Or alternatively, you can use your existing Laravel application. Start with requiring these two main packages:
composer require dejwcake/craftable composer require --dev dejwcake/admin-generator
Package installation
To install this package use:
php artisan craftable:install
This is going to install all dependencies, publish all important vendor configs, migrate, setup some configs, webpack config and run migrations.
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.
Basics
Once installed, navigate your browser to /admin/login
. You should be able to see a login screen.
Use these credentials to log in:
- E-mail:
admin@getcraftable.com
- Password: use password from you clipboard (it was printed in the end of the
craftable:install
command)
After authorization you should be able to see a default homepage and two menu items:
- Manage access
- Translations
Documentation
You can find full documentation of this package and other our packages Craftable uses at https://docs.getcraftable.com/#/craftable.
Composer
To develop this package, you need to have composer installed. To run composer command use:
docker compose run -it --rm test composer update
For composer normalization:
docker compose run -it --rm php-qa composer normalize
Run tests
To run tests use this docker environment.
docker compose run -it --rm test vendor/bin/phpunit -d pcov.enabled=1
To switch between postgresql and mariadb change in docker-compose.yml
DB_CONNECTION environmental variable:
- DB_CONNECTION: pgsql
+ DB_CONNECTION: mysql
Run code analysis tools
To be sure, that your code is clean, you can run code analysis tools. To do this, run:
For php compatibility:
docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache
For code style:
docker compose run -it --rm php-qa phpcs -s --colors --extensions=php
or to fix issues:
docker compose run -it --rm php-qa phpcbf -s --colors --extensions=php
For static analysis:
docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon
For mess detector:
docker compose run -it --rm php-qa phpmd ./src,./install-stubs,./resources,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml
Where to go next?
At this point you are ready to start building your administration area. You probably want to start building a typical CRUD interface for your eloquent models. You should definitely check our Admin Generator documentation.
In case you rather want to create some atypical custom made administration, then you probably want to head over to Admin UI package.
Have fun & craft something awesome!
How to contribute:
-
Drop a ⭐ on the Github repository (optional)
-
Before Contribute Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md.
-
Create an issue of the project or a feature you would like to add in the project and get the task assigned for yourself.(Issue can be any bug fixes or any feature you want to add in this project).
-
Fork the repo to your Github.
-
Clone the Repo by going to your local Git Client in a particular local folder in your local machine by using this command with your forked repository link in place of below given link:
git clone https://github.com/dejwcake/craftable
-
Create a branch using below command.
git branch <your branch name>
-
Checkout to your branch.
git checkout <your branch name>
-
Add your code in your local machine folder.
git add .
-
Commit your changes.
git commit -m"<add your message here>"
-
Push your changes.
git push --set-upstream origin <your branch name>
-
Make a pull request! (compare your branch with the owner main branch)
Contributors🌟
Kudos to these amazing people
Licence
MIT Licence. Refer to the LICENSE file to get more info.