Skip to main content


Showing posts from 2019

Laravel-PassPort API Example

How To Use Laravel Passport API Laravel passport What is Passport? APIs typically use tokens to authenticate users and do not maintain session state between requests. Laravel makes API authentication a breeze using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application development in a matter of minutes. You have to just follow a few steps to get following web services Login API Register API Details API Getting Started Step 1: Install Package composer require laravel/passport open config/app.php file and add service provider. config/app.php 'providers' =>[ Laravel\Passport\PassportServiceProvider::class, ], Step 2: Run Migration and Install php artisan migrate php artisan passport:install Step 3: Passport Configuration app/User.php <?php namespace App; use Laravel\Passport\HasApiTokens; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation

Read and write json file with php and mysql

JavaScript Object Notation or  JSON  is a lightweight data-interchange format which is very easy to read and write, we use JSON to transfer data from server to web-application or vice versa as an alternative to XML. In this post I will be showing you how to read and write JSON file with php and mysql. What is json? How does it looks? JSON is nothing but a data format similar like arrays. It comes in key value pair e.g. {Name:Rahul, Age:22}. JSON is a human-readable text format that is completely language independent but uses conventions of programming language like C, C++, JavaScript. See how JSON data looks like. [ { "player_name" : "Sachin Tendulkar" , "country" : "India" , "sports" : "Cricket" } , { "player_name" : "Roger Federer" , "country" : "Switzerland" , "sports" :

Send Push notification using php(FCM)

Hello, Here is our new topic. Sending push notification using FCM FCM FCM is a new version of GCM (Google Cloud Messaging) service. It is a cross-platform messaging service, used to send notifications that are displayed to the user. We can use any of three ways to send messages to the client app - single devices, groups of devices or devices subscribed to topics. It also sends acknowledgments back to the server. We can use FCM for iOS clients, Android clients, Unity clients, web clients and more. FCM is reliable and battery-efficient. Just copy and paste the code and change the credentials to yours <?php $url = "" ; $token = "your device token" ; $serverKey = 'your server token of FCM project' ; $title = "Notification title" ; $body = "Hello I am from Your php server" ; $notification = array ( 'title' => $title , 'body' =

Install SSL on Apache AWS server

Hello, My previous post was for SSL certification installation on nginx. Now in this we will see that how we can enable SSL on Apache. Navigate to apache configuration files /etc/httpd/conf Here you will get httpd.conf file. First of all you have to set the file permission to edit the file. After that you have to create new virtual directive in to it. open your httpd.conf file and update below code at the end of file. <VirtualHost *:443> ServerName DocumentRoot YOURDOCUMENTROOT SSLEngine on SSLCertificateFile Path to certificate file SSLCertificateKeyFile Path to key file </VirtualHost> In Above code replace your domain name and certificate file paths. Save above file and restart the apache by command Sudo service httpd restart After restarting the server you may face below listed error  Starting httpd: AH00526: Syntax error on line 356 of /etc/httpd/conf/httpd.conf: Invalid command &#

Install SSL on nginx

The following instructions will guide you through the SSL installation process on Nginx. If you have more than one server or device, you will need to install the certificate on each server or device you need to secure. What You’ll Need 1. Your server certificate This is the certificate you received from the CA for your domain. You may have been sent this via email. If not, you can download it by visiting your Account Dashboard and clicking on your order. 2. Your intermediate certificates These files allow the devices connecting to your server to identify the issuing CA. There may be more than one of these certificates. If you got your certificate in a ZIP folder, it should also contain the Intermediate certificate(s), which is sometimes referred to as a CA Bundle.  3. Your private key This file should be on your server, or in your possession if you generated your CSR from a free generator tool. On certain platforms, such as Microsoft IIS, the private key is not

A proud moment for Ambalal Koshti who first spotted Narendrabhai

अहमदाबाद में राज्य मुख्यालय में 66 वर्षीय राष्ट्रीय स्वयंसेवक संघ के कार्यकर्ता अंबालाल कोष्टी शुक्रवार को एक गौरवशाली व्यक्ति थे। वह एक थे, जिन्होंने मोदी को 18 साल की उम्र में देखा, फिर एक चाय की दुकान पर और दाढ़ी वाले युवाओं में चिंगारी की खोज की। कोष्टी ने उन्हें 1968 में आरएसएस के दिग्गज लक्ष्मणराव इनामदार से मिलवाया। लगभग दो दशक बाद, 1986 में, मोदी को आरएसएस द्वारा भाजपा में शामिल किया गया था। मोदी ने, उस व्यक्ति को भी याद किया, जिसने शुरुआत में उसे हाथ में लिया था और उसे 7, रेसकोर्स रोड, नई दिल्ली में राजमार्ग पर रखा था। कोशी याद करते हैं, "मुख्यमंत्री बनने के बाद, मैं उस दिन को नहीं भूल सकता, जब नरेंद्रभाई ने पार्टी कार्यकर्ताओं के साथ शिष्टाचार मुलाकात के दौरान मुझे अपना बॉस बताया था।" “यह बहुत खुशी का क्षण है। हम बहुत से लोगों को जनसंघ और फिर भाजपा के पाले में लाए हैं, लेकिन उनमें से एक देश का प्रधानमंत्री बनना उपलब्धि और संतोष की भावना देता है। मोदी के साथ अपनी पहली बातचीत को याद करते हुए, वे कहते हैं: “नरेंद्रभाई ने आरएसएस के साथ जुड़ने की उ