Answers for "laravel in array values should be unique"

PHP
1

get unique values in laravel

$users = User::select('name')->distinct()->get();
Posted by: Guest on February-19-2021
0

laravel list unique indexes

Schema::table('persons', function (Blueprint $table) {
    $sm = Schema::getConnection()->getDoctrineSchemaManager();
    $indexesFound = $sm->listTableIndexes('persons');

    if(array_key_exists("persons_body_unique", $indexesFound))
        $table->dropUnique("persons_body_unique");
});
Posted by: Guest on September-10-2021

Code answers related to "laravel in array values should be unique"

Browse Popular Code Answers by Language