File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,24 @@ public static function reports($lp)
1616 $ response .= '<div><i></i><span> ' . $ queryId . '</span></div> ' ;
1717 $ response .= '</li> ' ;
1818 }
19+ foreach ($ lp ->module ('views ' ) as $ queryId => $ view ) {
20+ $ response .= '<li data-url=" ' . route ('report_view ' , ['slug ' => $ lp ->slug , 'id ' => Str::slug ($ queryId )]) . '"> ' ;
21+ $ response .= '<div><i></i><span> ' . $ queryId . '</span></div> ' ;
22+ $ response .= '</li> ' ;
23+ }
1924 $ response .= '</ul> ' ;
2025 return $ response ;
2126 }
2227
28+ private function getViewData ($ slug , $ id )
29+ {
30+ foreach ($ this ->module ('views ' ) as $ viewId => $ view ) {
31+ if (Str::slug ($ viewId ) == $ id ) {
32+ return view ($ view );
33+ }
34+ }
35+ }
36+
2337 private function getQueryData ($ slug , $ id )
2438 {
2539 foreach ($ this ->module ('queries ' ) as $ queryId => $ query ) {
@@ -83,6 +97,14 @@ private function getQueryData($slug, $id)
8397 abort (404 );
8498 }
8599
100+ public function showView ($ slug , $ id )
101+ {
102+ $ this ->checkSlug ($ slug , 'read ' );
103+ $ data = $ this ->getViewData ($ slug , $ id );
104+ return $ data ;
105+ dd ($ data );
106+ }
107+
86108 public function show ($ slug , $ id )
87109 {
88110 $ this ->checkSlug ($ slug , 'read ' );
Original file line number Diff line number Diff line change 2323 Route::get (config ('admin.adminpath ' ), 'NickDeKruijk\Admin\Controllers\BaseController@view ' );
2424 Route::get (config ('admin.adminpath ' ) . '/{slug} ' , 'NickDeKruijk\Admin\Controllers\BaseController@view ' );
2525
26+ Route::get (config ('admin.adminpath ' ) . '/reports/view/{slug}/{id} ' , 'NickDeKruijk\Admin\Controllers\ReportController@showView ' )->name ('report_view ' );
2627 Route::get (config ('admin.adminpath ' ) . '/reports/{slug}/{id} ' , 'NickDeKruijk\Admin\Controllers\ReportController@show ' )->name ('report ' );
2728 Route::get (config ('admin.adminpath ' ) . '/reports/{slug}/{id}/csv ' , 'NickDeKruijk\Admin\Controllers\ReportController@csv ' )->name ('report_csv ' );
2829
You can’t perform that action at this time.
0 commit comments