Answers for "unique in laravel"

PHP
2

get unique values in laravel

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

laravel validate integer between

'item' => 'required|integer|between:1,10',
Posted by: Guest on October-21-2020
1

laravel unique validation

/**
 * Store a new blog post.
 *
 * @param  Request  $request
 * @return Response
 */

public function store(Request $request)
{
    $validatedData = $request->validate([
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ]);

    // The blog post is valid...
}
Posted by: Guest on June-03-2020
1

laravel set field unique

Schema::table('manufacturers', function($table)
{
    $table->string('name')->unique(); 
});
Posted by: Guest on March-31-2020
4

laravel validation

/**
 * Store a new blog post.
 *
 * @param  Request  $request
 * @return Response
 */
public function store(Request $request)
{
    $validatedData = $request->validate([
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ]);

    // The blog post is valid...
}
Posted by: Guest on October-19-2020
0

laravel rule unique where

'required|email|unique:company_users,email_address,NULL,id,company_id,' . $request->company_id
Posted by: Guest on October-09-2020

Browse Popular Code Answers by Language