Make Laravel Pivot Tables using the new Laravel 9 closure migration format

Overview

Make Laravel Pivot Tables using the new Laravel 9 closure migration format

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

This will allow you to create pivot table migration files using the new Laravel 9 closure migration format by simply passing two models. Under the hood the system will inspect the two models to generate the pivot table and foreign key names.

php artisan make:pivot Category Blog

Will generate the following migration

return new class extends Migration {
    public function up()
    {
        Schema::create('blog_category', function (Blueprint $table) {
            $table->foreignIdFor(Blog::class)->constrained()->onDelete('cascade');
            $table->foreignIdFor(Category::class)->constrained()->onDelete('cascade');
            $table->primary(['blog_id', 'category_id']);

            $table->index('blog_id');
            $table->index('category_id');
        });
    }

Installation

You can install the package via composer:

composer require josezenem/laravel-make-migration-pivot

Usage

php artisan make:pivot Category Blog

Optionally, you can publish the stubs using

php artisan vendor:publish --tag="laravel-make-migration-pivot-stubs"

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
Releases(1.0.1)
Owner
Jose Jimenez
Software Architect & Developer
Jose Jimenez
Quickly generate pivot tables for your projects

Laravel Pivot Table Generator Quickly generate pivot tables for your projects! Table of Contents Installation Usage More generator packages Contributi

Tim Wassenburg 5 May 30, 2022
Migrator is a GUI migration manager for Laravel which you can create, manage and delete your migration.

Migrator Migrator is a GUI migration manager for Laravel which you can create, manage and delete your migration. Installation: To install Migrator you

Reza Amini 457 Jan 8, 2023
Laravel Serializable Closure provides an easy way to serialize closures in PHP.

Serializable Closure Introduction This package is a work in progress Laravel Serializable Closure provides an easy way to serialize closures in PHP. I

The Laravel Framework 316 Jan 1, 2023
Belich Tables: a datatable package for Laravel Livewire

Belich Tables is a Laravel package base on Livewire and AlpineJS that allows you to create scaffold datatables with search, column sort, filters, pagination, etc...

Damián Aguilar 11 Aug 26, 2022
Add a progress bar column to your Filament tables.

Add a progress bar column to your Filament tables. This package provides a ProgessColumn that can be used to display a progress bar in a Filament tabl

Ryan Chandler 22 Nov 12, 2022
Specify the tables that you don't want to drop during refreshing the database.

Custom Fresh Custom Fresh allows fine-grain control of migrations inside your Laravel project. You can choose which tables will not be dropped during

Mahmoud Mohamed Ramadan 7 Jul 25, 2022
Effortlessly streamline tables and records printing in PDF/XLSX in your FilamentPHP application.

Filament Printables: a package to generate reports and form printables for your app. This is a work in progress thing Installation You can install the

fastOFI Corp 6 Jun 15, 2023
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
Run patches migration style in your Laravel applications.

This package generates patch files in the same fashion Laravel generates migrations. Each file is timestamped with an up and a down method and is asso

Anthony Rappa 44 Sep 9, 2022
PHP 7 Migration Assistant Report (MAR)

Introduction What is PHP 7 Migration Assistant Report(MAR)? PHP 7 MAR, or just "php7mar", is a command line utility to generate reports on existing PH

Alexia E. Smith 790 Dec 8, 2022
Magento Data Migration Tool

Overview We're pleased you're considering moving from the world's #1 eCommerce platform—Magento 1.x—to the eCommerce platform for the future, Magento

Magento 327 Jan 4, 2023
NYC Checkbook - Drupal 9 migration

Checkbook NYC Checkbook NYC is an open source financial transparency web application. Checkbook provides transparent access to a city's or other juris

Office of the Comptroller, City of New York 1 Jan 14, 2022
Validate PHP database migration files for compliance with best practices. Ensure db migrations are irreversible.

PHP DB Migration Validator Introduction In modern PHP frameworks such as Symfony and Laravel, migrations usually have up and down methods. In up metho

Anton Komarev 17 Dec 14, 2022
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Md. Rakibul Islam 50 Dec 26, 2022
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Md. Rakibul Islam 50 Dec 26, 2022
A simple validator package to check if the given zipcode has a valid Dutch zipcode format

Laravel Dutch Zipcode Validator A simple validator package to check if the given zipcode has a valid Dutch zipcode format Table of Contents Installati

Tim Wassenburg 0 May 30, 2022
Iconify icon sets in JSON format

100+ open source icon sets. Icons are validated, cleaned up, optimised, ready to render as SVG

Iconify 255 Dec 29, 2022
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
Laravel messenger. A full messenger suite for your new / existing laravel app

Laravel messenger. A full messenger suite for your new / existing laravel app! Private and group threads between multiple models, with real-time messaging, reactions, attachments, calling, chat bots, and more!

Richard  Tippin 290 Dec 30, 2022