Posts

Deploy Angular Project with CI /CD to Hostinger with FTP

 1. creat a folder in your project root folder with name .github 2. create second folder in .github/workflows 3. create file in your .github/workflows/main.yml paste this code in main.yml file on :   push :     branches : main <--- select your branch name name : 🚀 Deploy website on push jobs :   web-deploy :     name : 🎉 Deploy     runs-on : ubuntu-latest     steps :     - name : 🚚 Get latest code       uses : actions/checkout@v3     - name : Use Node.js 18       uses : actions/setup-node@v2       with :         node-version : '18'           - name : 🔨 Build Project       run : |         npm install               npm run build       - name : 📂 Sync files       uses : SamKirkland/FTP-Deploy-Action@v4.3.4   ...

Deploy Angular Project with CI /CD to Hostinger with FTP

 1. creat a folder in your project root folder with name .github 2. create second folder in .github/workflows 3. create file in your .github/workflows/main.yml paste this code in main.yml file on :   push :     branches : main <--- select your branch name name : 🚀 Deploy website on push jobs :   web-deploy :     name : 🎉 Deploy     runs-on : ubuntu-latest     steps :     - name : 🚚 Get latest code       uses : actions/checkout@v3     - name : Use Node.js 18       uses : actions/setup-node@v2       with :         node-version : '18'           - name : 🔨 Build Project       run : |         npm install               npm run build       - name : 📂 Sync files       uses : SamKirkland/FTP-Deploy-Action@v4.3.4   ...

Export Excel file from api in Laravel

         Installation   1. composer require maatwebsite/excel 2.php artisan make:export YourExcelExport 3. php artisan make:controller ExcelController  path app/export and  paste in your file  <?php namespace App\Exports ; use Maatwebsite\Excel\Concerns\ FromCollection ; use Maatwebsite\Excel\Concerns\ WithHeadings ; class YourExportClassName implements FromCollection , WithHeadings {     /**     * @return \Illuminate\Support\ Collection     */     protected $data ;         public function __construct ( $data )     {         $this -> data = $data ;     }         public function collection ()     {         return $this -> data ;     }         public function headings (): array     {         // Define the heading...

Sweet Alert

<link rel="stylesheet" type="text/css"  href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script>  / $(function() {     @if(Session::has('success'))     toastr.options = {         "closeButton": true,         "progressBar": true,     }     toastr.success("{{ session('success') }}")     @endif }); </script>

Decode Base64 image in html page

  < td >< img style = " width:100px;height:30px" src = " {{ 'data:image/png;base64,' . base64_encode ( file_get_contents ( public_path ('images/expenses/' .@ $list -> image ))) }} " alt = "Image" > </ td >

UPI QR code payment Gateway

  API :https://upiqr.in/ https://upiqr.in/api/qr?name=Krishna%20Bhardwaj&vpa=9140934715@ybl&amount=100

Change sql collation

 CHARACTER SET utf8 COLLATE utf8_unicode_ci;

get current date in laravel

First  method  to get current date ------- 1st step :  use Carbon\Carbon; 2nd step :    $today = \Carbon\Carbon::now()->format('Y-m-d').'%'; Second method to get current date ......    $date = \Carbon\Carbon::now();   $date =  \Carbon\Carbon::create($date , 'Asia/Kolkata');  $c_date = \Carbon\Carbon::createFromDate($date->year, $date->month,$date->day)->format('Y-m-d');

Select2 dropdown

for referrence :  https://select2.org/dropdown  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" integrity="sha512-nMNlpuaDPrqlEls3IX/Q56H36qvBASwb3ipuo3MxeWbsQB1881ox0cRv7UPTgBlriqoynt35KjEwgGUeUXIPnw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js" integrity="sha512-2ImtlRlf2VVmiGZsjm9bEyhjGW4dU7B6TNwh/hx/iSByxNENtj3WVE6o/9Lj4TJeVXPi4bnOIMXFIJJAeufa0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> Note * : <select name="reporting_to" class="form-select js-example-templating"  required> function formatState ( state ) { if (! state . id ) { return state . text ; } var baseUrl = "/user/pages/images/flags" ; var $state = $ ( '<span><img...

Calculate time in between to date and time in laravel

//  add this   on  top     use Carbon\ Carbon ; use DateTimeInterface ;     $starTime = $data -> check_in_time ; //dynamic value         // This is for start date by backend         $stopTime = Carbon :: now ();         // It is of diffence of time         $t1 = strtotime ( $starTime );         $t2 = strtotime ( $stopTime );         $hours = ( $t2 - $t1 )/ 3600 ;         $calculationTime = floor ( $hours ) . ' Hour ' . floor ( ( $hours - floor ( $hours )) * 60 ). ' Minutes' ;

How to use ternary operator in html class

                        < td >< span class = " <?php echo $user -> status == 'Success' ? 'badge-success' : 'badge-error' ? > badge" > {{ $user -> status }} </ span ></ td >

Fetch data by Ajax Loop

<script>     $(document).ready(function() {         // code to get all records from table via select box         $("#event_name").change(function() {             var id = $(this).find(":selected").val();             if (id == '') {                 id = 'A'             }             $.ajax({                 url: '{{ url('/ajax_event_management/team_creation_list') }}/' + id,                 method: 'get',                 data: {                     id: id                 },                 cache: false,        ...

Find Current month and Previous month

  <?php    $k=50;     $date=date('Y-m', strtotime(date('Y-m-d') . $k.' month'));        echo $year= substr($date,0,-3);    echo('<br>');      echo $month = substr($date,5);            ?> codeigniter code below:--- $k=0;                    $date=date('Y-m', strtotime(date('Y-m-d') . $k.' month'));                            $year = substr($date,0,-3);        $month = substr($date,5);                        $where = [                          'year(fees_date)'  => $year ,                       'month(fees_date)'...

Dynamic meta tags in php

 //  red  code for get current url  // green code for get dynamic meta  tags  In  Codeigniter  pass  the data in header page just like  below : $data = select record from table  $this->load->view('common/header,data);         <?php               if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')             $url = "https://";        else            $url = "http://";        // Append the host(domain name, ip) to the URL.        $url.= $_SERVER['HTTP_HOST'];             // Append the requested resource location to the URL        $url.= $_SERVER['REQUEST_URI'];                        $where=[ ...

Upload Excel file on MYSQl in CodeIgniter

Excel upload on MYSQL  

Excel file upload on MYSQL in Laravel

 goto site : https://laraveltuts.com/laravel-9-import-export-excel-csv-file-to-database-example/ and follow steps

Laravel Mailer

 <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Mail; use App\Http\Requests; use App\Http\Controllers\Controller; class Handover extends Controller { //    public function index() { //       $data = array('name'=>"Virat Gandhi");     //       Mail::send(['text'=>'mail'], $data, function($message) { //          $message->to('abc@gmail.com', 'Tutorials Point')->subject //             ('Laravel Basic Testing Mail'); //          $message->from('xyz@gmail.com','Virat Gandhi'); //       }); //       echo "Basic Email Sent. Check your inbox."; //    }    public function index(Request $request) {       // return $request;       $data = ['name'=>$request->name, 'shopname'=>$request-...

java script Form Validation

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>     <script type="text/javascript">     $(document).ready(function() {         $("# form-submit ").validate();     });     </script> Note  :  1. "required" is must on input field 2. write  id on  form tag   as like   --->   <form id=" form-submit "  action="#" method="post">

Find Customer Location code

//start----  <?php  $ch =curl_init(); curl_setopt($ch, CURLOPT_URL,"http://ip-api.com/json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result = curl_exec($ch); $result =json_decode($result); ?> //end code  for printing location =>  <?php echo("Country:".$result->country);?>

Mobile otp verification code

/* Start code//  <?php // Account details $apiKey = urlencode('enter your  api key');   // Message details         $numbers = '919140934715'; $sender = 'Jims Autos'; $message = 'This is your message'; $url = 'https://api.txtlocal.com/image-logo.png';   // Prepare data for POST request $data = array('apikey' => $apiKey, 'numbers' => $numbers, 'message' => $message);   // Send the POST request with cURL $ch = curl_init('https://api.txtlocal.com/send/'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch);  // Process your response here echo $response; ?>  end  code *//

java script get value from tag

<ul id="navMenus" class="booking-dates" data-bind="foreach: bookingDates">         <li><span data-bind="text: bdate, click: $parent.addDate">02 Apr</span></li>     </ul>  <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script> <script type="text/javascript">   $("#navMenus").on('click','li',function(){      $("#navMenus li.active").removeClass("active");  // this line for remove color when I click on  button.          var k = $(this).text();  // this line for gettting value when I click on  button       // alert(k);     $(this).addClass("active");  // this line for remove button onclick }); </script>

Popular posts from this blog

Ms Office 2019 activation link