Support the ongoing development of Laravel.io →
posted 7 years ago
Architecture
Last updated 2 years ago.
0

Hi!

I guess you have to set multiple unique columns. You can do it with unique or primary property.

$table->unique(array('mytext', 'user_id'));
$table->primary(['first', 'second']);

Like they said here:

http://stackoverflow.com/questions/20065697/schema-builder-laravel-migrations-unique-on-two-columns

0

@ttimot24 fantastic laravel support, many thanks friend :)

$table->unique(array('mytext', 'user_id'));
Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

erdely erdely Joined 7 Nov 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.