$post = Post::findOrFail($id);
$post->user()->sync([]);
$post->delete();
$post = Post::findOrFail($id);
$post->user()->delete();
$post->delete();
Schema::create('users_posts', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned()->index();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->integer('post_id')->unsigned()->index();
$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
});
gulp.task('build-css', function(){
gulp.src(scssFiles)
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(concatCss("style.css"))
.pipe(cleanCSS())
.pipe(gulp.dest(cssDist));
});
gulp.task('sass', () =>
gulp.src(variables.src.scss)
.pipe(errorNotifier.handleError(sass()))
.pipe(autoPrefixer({
browsers: ['last 2 versions', 'safari 5', 'ie 11', 'opera 12.1', 'ios 6', 'android 4'],
cascade: false
}))
.pipe(combineMq({
beautify: true
}))
.pipe(gulp.dest(variables.public.css))
.pipe(notify('Sass compile!'))
);
function is_touch_device() {
return 'ontouchstart' in window // works on most browsers
|| navigator.maxTouchPoints; // works on IE10/11 and Surface
};
tabs shadows css
INSERT INTO `test` (`id`, `boundary`) VALUES (NULL, PolygonFromText('POLYGON((1 1, 2 2, 3 3))')
let searchBar = document.querySelector('.search'),
searchInput = searchBar.querySelector('input'),
searchToggleBtn = document.querySelector('.search-toggle'),
searchParent = document.querySelector('.header_content');
searchInput.addEventListener('focus', function (event) {
searchBar.classList.add('expanded');
});
searchInput.addEventListener('blur', function (event) {
searchInput.value || searchBar.classList.remove('expanded');
});
searchToggleBtn.addEventListener('click', function (event) {
searchToggleBtn.classList.toggle('active');
searchParent.classList.toggle('search');
searchBar.classList.toggle('visible');
searchInput.focus();
});