$v = Validator::make($this->request->all(), [
'type' => 'required|in:1,2,3,'.$peremennaya,
]);
$v = Validator::make($this->request->all(), [
'type' => "required|in:1,2,3,{$peremennaya}",
]);
$v = Validator::make($this->request->all(), [
'type' => "required|in:".implode(',', $massiv_peremennih),
]);
->select(["booking_restaurants.type", "restaurants.type as restaurants_type"])
// Server URL Google Firebase Cloud Messages
$SERVER_URL = '';
// Server key FCM/GCM
$API_ACCESS_KEY = '';
// Массив токенов
$arTokens = [];
// Отправляем
$headers = [
'Authorization: key=' . $API_ACCESS_KEY,
'Content-Type: application/json'
];
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, $SERVER_URL);
curl_setopt( $ch,CURLOPT_POST, true );
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
$fields = [
'registration_ids' => $arTokens,
'data' => [
'message' => $message
]
];
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch);
curl_close( $ch );