Promise.props({
user: fetch('/user'),
products: fetch('/products')
}).then(initialState => {
const store = createStore(reducer, initialState);
render(<Provider store={store}><App /></Provider>, mountNode);
});
<?php
trait TraitTest
{
public function myFunction()
{
return 'trait myFunc';
}
public function getDescription()
{
return 'trait getDesc';
}
}
class MyClass
{
use TraitTest {
TraitTest::myFunction as protected traitMyFunc;
}
public function myFunction()
{
echo 'MyClass myFunc';
echo $this->traitMyFunc();
}
}
$MyClass = new MyClass();
echo $MyClass->myFunction();
(obj.func || _.noop)();
filterView: {
templateUrl: function (params) {
return 'templates/filter' + params.catID + '.html';
}
}
$result = Goods::query()
->whereHas('category', function ($query) use ($category) {
/** @var \Illuminate\Database\Query\Builder $query */
$query->where('cat_name', $category);
})
->whereHas('region', function ($query) use ($region) {
/** @var \Illuminate\Database\Query\Builder $query */
$query->where('region_name', $region);
})
->where('id', $id)
->with('category', 'region')
->first(); // можно ->firstOrFail() = само выкинет ошибку
if ($result === null) {
// 404
}