Skip to main content

ACL SETUP in default project

in user.php create relationship with roles

copy and paste role module permission
copy and paste check permissionn middleware insidc http/middleware folder
copy and paset user,rolemoduleand permission controller inside controllers
copy and paset migrations inside database 
copy and paste seeder to seed folder
copy and paste views file of module role user permission
copy and passte acl route in web.php
setting up permission
create middleware and copy handler fn and paste in it
now paste one line of code in kernal of middleware in routemiddlware
then set up in web.php



Comments

Popular posts from this blog

laravel file manager sorting by time default

Ref :  https://github.com/UniSharp/laravel-filemanager/issues/337 To load files order by "time DESC" you can change the code in vendor/unisharp/laravel-filemanager/src/traits/LfmHelpers.php public function sortFilesAndDirectories($arr_items, $sort_type) { if ($sort_type == 'time') { $key_to_sort = 'updated'; } elseif ($sort_type == 'alphabetic') { $key_to_sort = 'name'; } else { $key_to_sort = 'updated'; } return strcmp($a->{$key_to_sort}, $b->{$key_to_sort}); }); return $arr_items; } with public function sortFilesAndDirectories($arr_items, $sort_type) { if ($sort_type == 'time') { $key_to_sort = 'updated'; } elseif ($sort_type == 'alphabetic') { $key_to_sort = 'name'; } else { $key_to_sort = 'updated'; ...

Convert Html PAge to PDF using Canvas

Link :https://www.quora.com/How-we-export-html-page-as-pdf-using-pure-javascript app.js ( function (){ var form = $ ( '. printme ' ), cache_width = form . width (), a4 =[ 595.28 , 841.89 ]; // for a4 size paper width and height $ ( '#create_pdf' ). on ( 'click' , function (){ $ ( 'body' ). scrollTop ( 0 ); createPDF (); }); //create pdf function createPDF (){ getCanvas (). then ( function (canvas){ var img = canvas. toDataURL ( "image/png" ), doc = new jsPDF ({ unit : 'px' , format : 'a4' }); doc . addImage ( img , 'JPEG' , 20 , 20 ); doc . save ( 'FinalPrint.pdf' ); form . width ( cache_width ); }); } // create canvas object function getCanvas (){ form . width (( a4 [ 0 ]* 1.33333 ) ...

Stand Alone integration og file manager laravel

Reference:  https://unisharp.github.io/laravel-filemanager/integration <! doctype html > < html lang = "en" > < head > < meta charset = "UTF-8" > < title > Laravel Filemanager </ title > < link rel = "shortcut icon" type = "image/png" href = " {{ asset ('vendor/laravel-filemanager/img/folder.png') }} " > < link rel = "stylesheet" href = "//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" > < link rel = "stylesheet" href = "//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" > </ head > < body > < div class = "container" > < div class = "row" > < div class = "col-md-6" > < h2 > Standalone Image Button </ h2 > < div class = "input-group" > < span class = "i...