Download the PHP package leafs/schema without Composer

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



Leaf Schema

Latest Stable Version Total Downloads License

Schema files are a new way to define and manage your database structure in Leaf applications. Instead of writing complex migration files using PHP, and then managing multiple migrations for a single database table, you can now define a simplified structure using yml and let Leaf handle the rest.

This module packages the schema functionality into a standalone package which can be used in any PHP application once the port is complete.

If you use Leaf MVC, this is already included and configured for you.

To get started, install the schema module:

Once installed, you can start creating your schema files using the g:schema command:

Schema Files

Schema Files allow you to define your database tables, seed data, and keep track of your database automatically in one simple YAML file. They are clean, readable, and designed to help you move fast without the overhead. Every schema file is tied to a table in your database, for example, if you create a schema file called flights, it will be tied to the flights table in your database.

We can do this by running the command below:

This will create a new file in the database directory called flights.yml. You can open this file and start defining your table structure.

In this example, we have defined a table with three columns: to, from, and identifier, which are all of type string in this case, but can be any valid column type. You can view a full list of column types in the documentation.

Migrating Schema Files

Once you have defined your schema file, you can create the table in your database by running the migrate command:

This command will read all the schema files in the database directory and create the corresponding tables in your database. If the table already exists, it will update the table structure to match the schema file. You can also migrate a specific schema file by passing the name of the file as an argument:

Syncing Changes

The major difference between schema files and traditional migrations is that you don't have to create a new migration file every time you want to make a change to your table structure. Instead, you can simply update the schema file and run the migrate command again. Leaf will automatically detect the changes and apply them to the database if it is aware of the previous state of the table.

Other commands

You can perform other operations on your schema files like rolling back changes, refreshing the database, and seeding data. We recommend checking out the documentation for the full documentation on schema files and all the available commands.

💬 Stay In Touch

📓 Learning Leaf 3

😇 Contributing

We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our contribution guide and you'll be ready to make your first pull request 🚀.

To report a security vulnerability, you can reach out to @mychidarko or @leafphp on twitter. We will coordinate the fix and eventually commit the solution in this project.

🤩 Sponsoring Leaf

Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on open collective or check the contribution page for a list of ways to contribute.

And to all our existing cash/code contributors, we love you all ❤️

Cash contributors


Aaron Smith

Peter Bogner

Vano

🤯 Links/Projects


All versions of schema with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version *
leafs/date Version *
leafs/fs Version *
symfony/yaml Version *
leafs/sprout Version *
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 leafs/schema contains the following files

Loading the files please wait ...