var b;
start(343910101)
.then(res => {b = res})
.then(() => console.log(b));
.block:before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='0,100 100,0 100,100' style='fill:%23eefcff;' /%3E%3C/svg%3E");
left: 0;
top: -120px;
background-repeat: no-repeat;
background-size: 100% 100%;
content: '';
display: block;
height: 120px;
position: absolute;
width: 100%;
}
.block:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='0,100 100,0 100,100' style='fill:%23eefcff;' /%3E%3C/svg%3E");
right: 0;
bottom: -120px;
background-repeat: no-repeat;
background-size: 100% 100%;
content: '';
display: block;
height: 120px;
position: absolute;
width: 100%;
transform: rotateX(180deg);
}
Как правильно решить данную задачу?
The :last-child pseudo-class represents an element that is the last child of some other element. Same as :nth-last-child(1).
function __construct() {
$this->middleware('auth', ['only' => ['create', 'store']]);
}
$router->resource('adboard', 'AdboardController');
echo \App\Models\User::find(Auth::user()->id)->GetUserPhoto->name;
Auth::user()
и так содержит объект модели User. Зачем получать id из модели, и снова делать запрос к базе?{{ Auth::user()->GetUserPhoto->name }}
public function userPhoto() {
return $this->hasOne('App\Models\Photo_user'); // Советую называть модели как нормальные люди. UserPhoto - как вариант. Забудьте нижнее подчеркивание, весь Laravel - это CamelCase.
}
public function getUserPhotoAttribute(){
if ( ! array_key_exists('userPhoto', $this->relations))
$this->load('userPhoto');
$related = $this->getRelation('userPhoto')->first();
return ($related) ? $related->name : false; // выводим userPhoto->first()->name
}
{{ Auth::user()->userPhoto }}
public function getPhotoNameAttribite()
{
return $this->GetUserPhoto->name;
}
echo \App\Models\User::find(Auth::user()->id)->photoName;