public function scopeByPartnerId($query, int|array $partnerId)
{
if (is_countable($partnerId)) {
$query->whereIn('partner_id', $partnerId);
} else {
$query->where('partner_id', $partnerId);
}
}
я хотел потестить listener отдельно unit тестом (проверить, что метод handle вызывается и никто его не удалил)Здесь разумно сделать три теста:
If you would like to continue using the original auto-prefixed controller routing, you can simply set the value of the $namespace property within your RouteServiceProvider and update the route registrations within the boot method to use the $namespace property
public function countVoteStats($count_id) {
$model = self::find($count_id);
return [
'agree' => $model->convVote->sum('agree'),
'disagree' => $model->convVote->sum('disagree'),
'neutral' => $model->convVote->sum('neutral'),
];
}
public function countVoteStats($count_id) {
$query = conv_voting::where('conv_id', $count_id);
return [
'agree' => $query->sum('agree'),
'disagree' => $query->sum('disagree'),
'neutral' => $query->sum('neutral'),
];
}
@if($bool) 42 @endif
писать {{ $bool ? '42' : '' }}
.<span> One </span>
<span>
Two
</span>
One Two
$data = $api->getJson();
$model = new YourModel($data);
Method App\Http\Controllers\PageController::national-students21 does not existЭто ошибка переводится как "метод
national-students21
класса App\Http\Controllers\PageController
не существует. Собственно, с таким именем он и не может существовать, это синтаксическая ошибка.category_id
переводится как "идентификатор категории" (единственное число). Тип этого столбца - число. Почему вы решили, что туда можно записать массив (и почему-то строк)?--seed
и дело всё-таки в фабрике? Нам остаётся только гадать.SELECT name FROM table1 where id = user_id
UNION ALL
SELECT name FROM table2 where id = user_id
UNION ALL
SELECT name FROM table3 where id = user_id
$first = DB::table('table1')
->where('id', 'user_id')
->select('name');
$second = DB::table('table2')
->where('id', 'user_id')
->select('name');
$third = DB::table('table3')
->where('id', 'user_id')
->select('name');
$results = $first
->union($second)
->union($third)
->get();
(new BooksListHist)
->setTable("lst_books_hist({$IdFilter['value']})")
->first();
$rules = [...];
foreach ($this->get('some-field') as $index => $item) {
switch ($item['type']) {
case 'some-type':
$rules["some-field.{$index}"] = [
'some-rule',
]
break;
}
}
return $rules;