import '../../node_modules/moment'
import moment from 'moment';
.FILESYSTEM_DRIVER=local
на publicphp artisan storage:link
public function news()
{
return $this->belongsToMany('App\News', 'news_to_rubric', 'rubric_id', 'news_id');
}
$rubrics = Rubric::with('news')
->get();
@foreach ($rubrics as $rubric)
{{$rubric->name}}
@foreach ($rubric->news as $news)
{{ $news->name }}
@endforeach
@endforeach
console.log(
"498065392975507667366026341067548906436328316841307936116457316164193184705285250962660148627300967657213217328759941177315742017903027130095729437206958025287403606910196074469378649164695055964366281024547871829070617652494336"
.split("")
.reverse()
.join("")
.replace(/\d\d\d/g, "$& ")
.split("")
.reverse()
.join("")
);
$(function() {
let $chart = $('[data-type="chart"]');
for (let i = 0; i < $chart.length; i++) {
(function(index) {
$.ajax({
success: function() {
console.log('Замыкание', index);
}
})
})(i);
}
});
$(function() {
var $chart = $('[data-type="chart"]');
if ($chart.length) {
ajaxAll($chart, function(index) {
return getChartData($(this).data('url'), index);
}).done(function() {
console.log('ajaxAll', 'Все запросы завершенны');
});
}
function ajaxAll($selector, each) {
var promise = [];
$.each($selector, function() {
promise.push(each.apply(this, arguments));
});
return $.when.apply(null, promise);
}
function getChartData(link, index) {
return $.ajax({
url: link,
method: 'POST',
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({
data: {
item: index
}
}),
success: function(response) {
console.log('getChartData', 'Одиночный запрос завершен успешно', index);
}
});
}
});
<a href="images/img.jpg" download>Скачать картинку</a>
function auto_play() {
var act = $('.controlNav > li.act');
act.next().trigger('click');
}
var autoPlay = setInterval( auto_play, 4000 );
slider.hover(function(){
clearInterval(autoPlay);
}, function(){
autoPlay = setInterval( auto_play, 4000 );
});