Skip to main content

Posts

print in loop in php easy way

<script type="text/javascript"> function PrintDiv() { var divToPrint = document.getElementById('divToPrint'); var popupWin = window.open('', '_blank', 'width=300,height=300'); popupWin.document.open(); popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>'); popupWin.document.close(); } </script> <div id="divToPrint" style="display:none;"> <div style="width:200px;height:300px;background-color:teal;"> <?php echo $html; ?> </div> </div> <div> <input type="button" value="print" onclick="PrintDiv();" /> </div>

Auto posting on facebook

Reference: https://packagist.org/packages/laravel-notification-channels/facebook-poster https://sujipthapa.co/blog/generating-never-expiring-facebook-page-access-token for image also: https://techanical-atom.com/post-on-facebook-page-via-laravel-notification/?fbclid=IwAR374VsySPcqW2tt78xByxEH1kNNNHX74D-q62Fd-wYr3rzDQ91JA7-4RpA https://sujipthapa.co/blog/automatically-posting-to-facebook-page-via-laravel-notifications sub: https://github.com/alihesari/laravel-social-auto-posting?fbclid=IwAR002Nv3tkonSNiG--FXw2_V9zUhwAsFi8WApfWiUMV-tvCSWQ9-IL5H6g4 Let me explain what i have done here... composer require laravel - notification - channels / facebook - poster inside config/server.php: 'facebook_poster' = > [ 'app_id' = > env ( 'FACEBOOK_APP_ID' ) , 'app_secret' = > env ( 'FACEBOOK_APP_SECRET' ) , 'access_token' = > env ( 'FACEBOOK_ACCESS_TOKEN' ) , ] , Now, create notif...

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...

some important points for web developers and hosting

check dns https://www.whatsmydns.net/ https://check-host.net/ https://www.site24x7.com/ping-test.html attacks https://www.computerhope.com/unix/uping.htm https://vitux.com/linux-ping-command/ https://www.howtoforge.com/linux-ping-command/ https://www.poftut.com/linux-ping-command-tutorial-examples/ https://phoenixnap.com/kb/linux-ping-command-examples https://sandilands.info/sgordon/ping-flooding-dos-attack-in-a-virtual-network https://www.geeksforgeeks.org/ping-command-in-linux-with-examples/

get all news associated with a category many to may relationship laravel

public function categoryid ( $id ) { // $news = News::whereHas('categories', function ($query) use ($id) { // $query->where('category_id', $id); // })->where('status', '1')->where('is_publish', '1')->get(); $next = News :: with ([ 'categories' => function ( $query ) use ( $id ){ $query -> where ( 'category_id' , $id ); }])-> where ( 'id' , '>' , $id )-> orderBy ( 'id' , 'asc' )-> get (); return json_encode ( $next ); }

get all unique row with having one column which is not primary key distinct

get all unique row with having one column which is not primary key distinct in laravel:       $datas= Modelname::select()->groupBy('field_name')->get(); now, you will get the error something like non aggrigated bla bla.. so for this you need is .. just go to database.php file inside config folder and find 'strict' and make it false 'strict' => false , now you are done ... you will get the required datas correctly