Git Product home page Git Product logo

xeed's Introduction

Xeed - Resources Generator for Laravel

ν•œκΈ€(Korean) πŸ‘ˆ

code-style run-tests Packagist Version Packagist Downloads Packagist Dependency Version Laravel Version Packagist Dependency Version Packagist Stars Packagist License

The Xeed is to generate new model, seed, database seed, factory and migration files for Laravel based on data from the existing database table.

Tip

It can function as both php artisan xeed:* commands for Laravel and bin/console * commands for Standalone, providing 100% identical functionality. Therefore, you can use it within your own Laravel project or as a standalone application.

We have provided the API Documentation on the web. For more information, please visit https://www.palgle.com/xeed/ ❀️

Features

  • Database testing is supported
  • Generate models for Laravel
  • Generate seed files for Laravel
  • Generate database seed files for Laravel
  • Generate factories for Laravel
  • Generate migrations for Laravel
  • Laravel multi & reserved columns supported
  • Laravel integration
  • MySQL, SQLite and PostgreSQL supported

Support & Tested

MySQL Supported SQLite Supported PostgreSQL Supported PHP 8.0.2+ Supported PHP 8.1.0+ Supported PHP 8.2.0+ Supported PHP 8.3.0+ Supported

Caution

PostgreSQL support is in beta. If you encounter any issues, please report them via GitHub issues.

Preview

Laravel:

Preview

Standalone:

Preview

Installation

composer require cable8mm/xeed --dev
# For Laravel
composer create-project cable8mm/xeed
# For Standalone

Important

Edit the .env file to configure your own database. You can manually copy .env.example to .env whenever you need to.

Usage

Generate Models

php artisan xeed:models
# Generate all models from database in `app/Models` folder

php artisan xeed:models -f -t xeeds
# Force to generate a model from `xeeds` table in `app/Models` folder
bin/console models
# Generate all models from database in `dist/app/Models` folder

bin/console models -f -t xeeds
# Force to generate a model from `xeeds` table in `app/Models` folder

Generate Seeders

php artisan xeed:seeders
# Generate all seeds from database in `database/seeders` folder

php artisan xeed:seeders -f -t xeeds
# Force to generate a seeder from `xeeds` table in `database/seeders` folder
bin/console seeders
# Generate all seeds from database in `dist/database/seeders` folder

bin/console seeders -f -t xeeds
# Force to generate a seeder from `xeeds` table in `dist/database/seeders` folder

Generate DatabaseSeeder

php artisan xeed:database
# Generate a database seed from database in `database/seeders` folder
bin/console database
# Generate a database seed from database in `dist/database/seeders` folder

Generate Factories

php artisan xeed:factories
# Generate all factories from database in `database/factories' folder

php artisan xeed:factories -f -t xeeds
# Force to generate a factory from `xeeds` table in `database/factories' folder
bin/console factories
# Generate all factories from database in `dist/database/factories' folder

bin/console factories -f -t xeeds
# Force to generate a factory from `xeeds` table in `database/factories' folder

Generate Migrations

php artisan xeed:migrations
# Generate all migrations from database in `database/migrations' folder

php artisan xeed:migrations -f -t xeeds
# Force to generate a migration from `xeeds` table in `database/migrations' folder
bin/console migrations
# Generate all migrations from database in `dist/database/migrations' folder

bin/console migrations -f -t xeeds
# Force to generate a migration from `xeeds` table in `database/migrations' folder

The generated files are stored in the same folder as your Laravel project. Please check the dist folder.

Helpful commands

If you are going to test this package yourself, then you would use the following commands to clean up generated files.

php artisan xeed:clean
# Clean generated files, seeders, models, factories and migration files.
#=> Refer the below
Please select directory for you to want to clean.
  [0] seeder
  [1] model
  [2] factory
  [3] migration
  [4] all
  [5] exit
bin/console clean
# Clean generated files, seeders, models, factories and migration files.
#=> Refer the below
Please select directory for you to want to clean.
  [0] seeder
  [1] model
  [2] factory
  [3] migration
  [4] all
  [5] exit

Formatting

composer lint
# Modify all files to comply with the PSR-12.

composer inspect
# Inspect all files to ensure compliance with PSR-12.

Testing

It uses the built-in SQLite database, not your own database. It will never cause harm to your data. You don't need to worry about that.

composer testpack
# All tests with Laravel artisan commands
composer test
# All tests without Laravel artisan commands

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

The below can help you contribute.

The Xeed has a built-in SQLite database, allowing you to contribute easily without needing your own database. Simply create a new file for testing purposes and utilize it.

touch database/database.sqlite
# Create a new empty file for SQLite database

And then,

composer test
# Run tests

Database seeds

For migrations and factories, when you need to execute tests for all database field types, utilize the following command.

php artisan xeed
# Import an 'xeeds' Table into the Database

php artisan xeed drop
# Drop the 'xeeds' Table from the Database
bin/console xeed
# Import an 'xeeds' Table into the Database

bin/console xeed drop
# Drop the 'xeeds' Table from the Database

Utilize migration files for all database field types by referring to the following location database/*.sql these files are saved in the specified folder.

Credits

License

The Xeed project is open-sourced software licensed under the MIT license.

xeed's People

Contributors

cable8mm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xeed's Issues

Commands for one table

Hello!

First of all great package.

It would be nice if you add a command for generate migration/seed/factory/etc for one table

por example:

php artisan xeed:seeder table_name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.