Search
 
SCRIPT & CODE EXAMPLE
 

PHP

validation not exists with this id laravel

$e = Subscription::find($request->subscription_id);
$rules = [
  'subscription_id' => 'required|integer|exists:subscriptions,id',
  'date' => 'required|date|after:yesterday',
  'date' => Rule::unique('member_attendances')->where(function ($query) use ($e) {
              return $query->where('member_id', $e->member_id);
})
//|unique:member_attendances,date,'.$e->member_id . ',member_id',
];
Comment

PREVIOUS NEXT
Code Example
Php :: laravel validation unique if this field is changed 
Php :: how to add property to an exsisting object in php 
Php :: php number_format 
Php :: write in a file using php 
Php :: install soap in php linux 
Php :: Laravel Validation error message in blade or view 
Php :: concat function using laravel update query 
Php :: get file name from url in php 
Php :: add column to migration laravel 
Php :: array_unique multidimensional php 
Php :: laravel eloquent to array key value 
Php :: insall laravel 
Php :: searching inside a file using php 
Php :: how to check mobile or desktop in php 
Php :: php microtime to seconds 
Php :: woocommerce get post meta 
Php :: composer create project laravel 
Php :: php get tempfile 
Php :: get current month records in laravel 
Php :: foreach loop laravel 
Php :: yii2 postgresql connection 
Php :: laravel exists eloquent 
Php :: php stop execution 
Php :: php validate date format yyyy-mm-dd 
Php :: laravel withHeaders bearer 
Php :: get ip country 
Php :: migrations required field laravel 
Php :: carbon equal dates 
Php :: get static front page 
Php :: 2 decimal round using php 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =