$a_data = array_merge($a_data, array_fill(0, 100, 0));
Product::whereDoesntHave('collections', function (Builder $query) {
return $query->whereIn('id', [15]);
})->orderBy('created_at', 'desc')->limit(4)->get();
class OrderUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return $this->order->canChangeStatus($this->get('status'))&&$this->order->canUpdate();
}
}
switch ($this->getMethod())
{
case 'PATCH':
return [
'table_id' => ['numeric', 'exists:tables,id'],
'user_id' => ['numeric', 'exists:users,id'],
'status' => ['string', 'in:'. Order::NEW.','.Order::WORK.','.Order::CLOSE.','.Order::PAID],
];
case 'PUT':
return [
'table_id' => ['required', 'numeric', 'exists:tables,id'],
'user_id' => ['required', 'numeric', 'exists:users,id'],
'status' => ['required', 'string', 'in:'. Order::NEW.','.Order::WORK.','.Order::CLOSE.','.Order::PAID],
];
}
<table>
<tr>
<th>Имя</th><th>Фамилия</th><th>Email</th>
</tr>
<tr>
<td><input name="name[]"></td><td><input name="family[]"></td><td><input name="email[]"></td>
</tr>
<tr>
<td><input name="name[]"></td><td><input name="family[]"></td><td><input name="email[]"></td>
</tr>
<tr>
<td><input name="name[]"></td><td><input name="family[]"></td><td><input name="email[]"></td>
</tr>
<tr>
<td><input name="name[]"></td><td><input name="family[]"></td><td><input name="email[]"></td>
</tr>
</table>
When a container is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh, .sql and .sql.gz that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. You can easily populate your mysql services by mounting a SQL dump into that directory and provide custom images with contributed data. SQL files will be imported by default to the database specified by the MYSQL_DATABASE variable.