cnizzardini / cakephp-sakila-plugin
A data seeder based on the MySQL Sakila database for CakePHP 4.x
Installs: 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: ^8.1
- cakephp/cakephp: ^5.0
- cakephp/migrations: ^4.0
- robmorgan/phinx: ^0.15.0
Requires (Dev)
- phpunit/phpunit: ^10.0
README
This Cake 4 plugin comes with a snapshot and data seeds for the MySQL Sakila Sample Data. I found myself needing test data when I am creating new plugins and wanted something with complex enough relations for realistic development. While the SQL dump provided by MySQL is okay, it doesn't follow full Cake conventions. This plugin includes full cake conventions and additional schema improvements.
Install
composer require cnizzardini/cakephp-sakila-plugin bin/cake plugin load Sakila
Alternatively after composer installing you can manually load the plugin in your Application:
# src/Application.php public function bootstrap(): void { // other logic... $this->addPlugin('Sakila'); }
Usage
Run migrate and seed with -p Sakila
bin/cake migrations migrate -p Sakila bin/cake migrations seed -p Sakila
Baking
You should now be able to bake a full application skeleton
bin/cake bake all --everything
Verify everything is working by running bin/cake server
Schema
See config/Migrations/20200422015732_Initial.php for full schema.
Unit Tests
Unit tests ensure the schema can be built and seeders run. It uses cakephp/migrations
and SQLite for the data store.
vendor/bin/phpunit