`DATE_INSERT` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
$result = '';
foreach ($comments as $comment){
$result .= view('comment')->with('comment', $comment)->render();
}
<?php
var_dump(unpack('C*', hash_hmac('sha256', 'Just simple test string', 'Very_secret_key!', true)));
То есть напрямую изменить одно поле в массиве входящих данных?
Illuminate\Http\Request::macro(
'mergeGently', function($array){
// где делаем магию аля проверки и прочее.
});
Как его туда прокинуть?
public function register()
{
$this->renderable(function (ValidationException $exception) {
return redirect($exception->redirectTo ?? url()->previous())
->withInput(Arr::except($exception->validator->getData(), $this->dontFlash))
->withErrors($exception->errors(), $exception->errorBag);
});
}
select * from news order by (id > ИД_ТЕКУЩЕЙ НОВОСТИ) desc, id limit 5;
SELECT
(SELECT group_concat(idTag) FROM tag_in_record WHERE idRecord = 7060) AS list,
*
FROM records WHERE id = 7060
SELECT
*,
group_concat(idTag) AS list
FROM records
join tag_in_record on tag_in_record.idRecord = records.id
WHERE id = 7060
group by records.fields
SELECT id, created_at, contact_id, status
FROM contact_status
WHERE
contact_status.id in (select max(id) as id from contact_status group by contact_id)
contact_status.status = 'authorized'
ORDER BY contact_id, created_at DESC
SELECT id, created_at, contact_id, status
FROM contact_status
WHERE
contact_status.id in (select max(id) as id from contact_status where contact_id=121750 group by contact_id )
contact_status.status = 'authorized'
ORDER BY contact_id, created_at DESC
Post::where('status', 1)
->join('post_tag', 'posts.id', '=', 'post_tag.post_id')
->join('tags', 'tags.id', '=', 'post_tag.tag_id')
->select('posts.*', DB::raw('group_concat(tags.name) as tags_name'))
->groupBy('posts.id', 'posts.name', 'posts.content')->get();
Post::where('status', 1)
->select('posts.*', DB::raw('select group_concat(tags.name) as tags_name from post_tag join tags on tags.id=post_tag.tag_id where post_tag.post_id = posts.id'))->get();