The Laravel Schema class provides a database agnostic way of manipulating tables. It works well with all of the databases supported by Laravel, and has a unified API across all of these systems.
A foreign key is a field that is used to establish the relationship between two tables via the primary key (You can also use a non-primary field but not recommended). In this tutorial, I show how you can add a foreign key constraint while creating a table using migration in the Laravel 8 project.
The configuration for Laravel's database services is located in your application's config/database. php configuration file. In this file, you may define all of your database connections, as well as specify which connection should be used by default.
Currently Laravel supports four database systems: MySQL, Postgres, SQLite, and SQL Server.
How can I create a Mediumblob
within the Laravel schema builder ?
In the docs it says :
$table->binary('data'); // BLOB equivalent to the table
But I need a MediumBlob otherwise the images get truncated at 64K; we are running MySQL.
I know that Laravel's schema builder is DB agnostic, but is there a way to avoid the "native way" and if not how can i create a Mediumblob
column ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With