Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cycle Orm Adapter Laravel Package

wayofdev/laravel-cycle-orm-adapter

View on GitHub
Deep Wiki
Context7

import {Callout} from "nextra-theme-docs"; import {OptionTable} from "../../components/env-table"; import AsciinemaPlayer from "../../components/asciinema-player/player";

Migration Commands

Migration commands are essential for managing your database's evolution over time. They allow for the creation, execution, rollback, and status checking of migrations.

Command Reference Table

export const columns = [ { key: 'command', header: 'Command', headerClassName: '', cellClassName: 'whitespace-pre py-2 font-mono text-xs font-semibold leading-6 text-violet-600 dark:text-violet-500' }, { key: 'description', header: 'Description', headerClassName: 'px-6', cellClassName: 'py-2 pl-6', } ]

export const commands = [ ["cycle:migrate:init", "Initializes the migration system by creating the necessary migrations table."], ["cycle:migrate", "Executes pending migrations. Use the --one flag to execute only the first pending migration."], ["cycle:migrate:replay", "Replays migrations by rolling them back and then re-applying them. Use the --all flag to replay all migrations."], ["cycle:migrate:rollback", "Rolls back the last batch of migrations by default. Use the --all flag to roll back all migrations."], ["cycle:migrate:status", "Displays the status of all migrations, indicating which have been applied."], ["cycle:migrate:fresh", "Drops all tables and re-runs all migrations, providing a clean slate. ⚠️"] ];

<OptionTable options={commands.map(([command, description]) => ({ command, description }))} columns={columns} />

Initializing Migrations

cycle:migrate:init

This command is your starting point for migration management. It initializes the migration system by creating the necessary migrations table in your database, ensuring that you can start tracking and executing migrations.

Usage

php artisan cycle:migrate:init

Running Migrations

cycle:migrate

To apply pending migrations to your database, use the cycle:migrate command. This will execute all migrations that have not yet been applied, updating your database schema accordingly.

Usage

php artisan cycle:migrate

Options

  • --one: Executes only the first pending migration, allowing for more granular control over the migration process.

Example

Recording shows the visualization of applying migrations to the database.

<AsciinemaPlayer src="https://asciinema.org/a/sRNJPTQZTHxRoiGVAqxKvR48K.cast" options={{ idleTimeLimit: 2, preload: true, loop: 0, speed: 1.0, theme: 'monokai', rows: 28, cols: 120, poster: "npt:0:03" }} />

Replaying Migrations

cycle:migrate:replay

This command facilitates the replaying of migrations by first rolling them back and then re-applying them. It's particularly useful for development environments where you need to quickly test changes to migrations.

Usage

php artisan cycle:migrate:replay

Options

  • --all: Replays all migrations, effectively refreshing your entire database schema.

Rolling Back Migrations

cycle:migrate:rollback

To undo the last batch of migrations, you can use the cycle:migrate:rollback command. This is useful when you need to revert changes made by the most recent migrations.

Usage

php artisan cycle:migrate:rollback

Options

  • --all: Rolls back all migrations, allowing you to revert your database schema to its initial state.

Checking Migration Status

cycle:migrate:status

Keeping track of which migrations have been applied is crucial for database management. The cycle:migrate:status command displays the status of all migrations, indicating which have been applied and which are pending.

Usage

php artisan cycle:migrate:status

Fresh Schema Command

cycle:migrate:fresh

When you need to start from a clean slate, the cycle:migrate:fresh command drops all tables from the database and re-runs all migrations. This is particularly useful for resetting the database to a known state during development or testing.

Usage

php artisan cycle:migrate:fresh

Options

  • --seed: Seeds the database after running the migrations, populating it with initial data.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity