$post = new Post();
$post->create($request->all());
foreach($request->get('categories') as $categoryId){
$category = Categories::find($categoryId);
$post->categories()->save($category);
}
class User extends Authenticatable
{
public function comments()
{
return $this->hasMany(Comment::class);
}
}
class Comment extends Model
{
public function user()
{
return $this->belongsTo(User::class);
}
}
class CommentController extends BaseController
{
public function index()
{
return Comment::with('user')->get();
}
}
// Extra small devices (portrait phones, less than 576px)
// No media query since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
ymaps-2-1-68-balloon__content
ymaps-2-1-69-balloon__content
.ymaps-2-1-68-balloon__content > ymaps
$("body").on("click", ".close-button", function () {
const index = $(this).attr('id');
$('.general_block_' + index).remove();
$('.close-button').each(function( index ) {
$(this).parent('div').attr('id', index);
});
}
<div class="general_block" id="1"><div align="center"></div><div class="close-button"></div></div>
<div class="general_block" id="2"><div align="center"></div><div class="close-button"></div></div>
<div class="general_block" id="3"><div align="center"></div><div class="close-button"></div></div>
<div class="general_block" id="4"><div align="center"></div><div class="close-button"></div></div>
$("body").on("click", ".close-button", function () {
var closeButton = $(this);
var generalBlock = closeButton.parents('.general_block');
var alignedElement = generalBlock.find('.center');
// тут уже можете делать, что хотите..
generalBlock.remove();
}