var l={
list: {
"action_buttons[0]": "View",
"action_buttons[1]": "Share",
"action_buttons[2]": "Download",
"columns[0]": "Date of Study",
"columns[1]": "Patient",
"columns[2]": "File name",
"columns[3]": "Reporting <br>Physician",
"columns[4]": "Institution"
}
};
var n = {};
for (var item in l.list) {
if (l.list.hasOwnProperty(item)) {
r = item.replace(/\[\d\]/,'');
if(n[r]==undefined){ n[r]=[] }
n[r].push(l.list[item]);
}
}
l.list = n;
console.log(l);
foreach(\App\Menu::all() as $menu){
Route::get($menu->module_slug, $menu->module_slug.'Controller@index');
Route::get($menu->module_slug.'/{slug}', $menu->module_slug.'Controller@by_slug');
}
// хотя если пунктов меню не слишком много лучше сделать как предложено выше
...
// module_slug = 'Brand'
class BrandController{
... index(){}
.... by_slug(\App\Brand $slug){}
}
+ использовать https://laravel.com/docs/5.6/routing#route-model-b... class AppServiceProvider extends ServiceProvider
{
public function boot()
{
\URL::forceScheme('https');
LIKE '%".$startFrom."%' ... LIMIT {$startFrom}, 100
LIKE '%101%' ... LIMIT 101, 100
-- или
LIKE '%learn sql%' ... LIMIT learn sql, 100</code
<li><label><input name="question[{{$question->id}}]" type="radio" value="a">Постоянно</label></li>
<li><label><input name="question[{{$question->id}}]" type="radio" value="b">Иногда</label></li>
<li><label><input name="question[{{$question->id}}]" type="radio" value="c">Время от времени</label></li>
Route::get('/robots.txt',function(){
return response()->streamDownload(function () {
echo \App\Block::where('kind', 'robots.txt')->first()->code;
}, 'robots.txt', ['Content-Type'=>'text/plain'],'inline');
});
class ReportRepository{
function __construct(ReportableModelInterface $model){}
function getSimpleReportData($id){}
function getCustomReportData($id, $any){}
}
var regex1 = RegExp('^[A-Z]{5}[A-Z]*$', 'i');
var str1 = 'asaas1a';
console.log(regex1.test(str1));
// GET site.ru/seo_friendly_article_name
Route::get('/{article_slug}', 'ArticleController@article');
// в контроллере
public function article(Article $article_slug){
// определяете нужное представление
return view("articles.categories.{$article_slug->category_id}.show", ['article' => $article_slug]);
}