git –version

Set user name and email

git config –list ( for list all configuration settings)

git config –global “abhinav”

git config –global “”

Remove git added file:

git reset <filename>

Remove git commit file: local changes will not remove.

git reset HEAD^

git reset HEAD ~ 1

Remove git commit with changes:

git reset –hard HEAD^

Create Git .ignore file

touch .gitignore

Ignore git tracked file:

git rm –cached a.log

git rm -r –cached logs

Exclude from the management of Git

git update index –assume-unchanged .env.example

Restore to the management of Git

git update index –no-assume-unchanged .env.example

Create branch from local:

git checkout -b new_branch_name

Move code from One git account to Another one:

git remote set-url origin GIT-HTTP-URL (from first account)

git pull origin BRANCH-NAME

git remote set-url origin GIT-HTTP-URL (from second account)

git push origin BRANCH-NAME ( or you can create new branch on local then push that branch)

lazy loader/Infinite Scroll Pagination Using Laravel & jScroll – Laraget

Instead of having to click a link to get to the next set of content, infinite scrolling (also known as lazy loading, endless scrolling, autopager, endless pages, etc.) pulls the next content automatically into view when the reader approaches the bottom of the page.

If you want to implement infinite scroll pagination using Laravel, get the jScroll (a jQuery plugin written by Philip Klauzinski) include in page.

Add this code in your page


<\script type=”text/javascript”>
// jquery.jscroll.js using for auto scroll
$(function() {
autoTrigger: true,
autoTriggerUntil: false,
loadingHtml: ‘<img class=”center-block” src=”‘+base_url+’/img/loading.gif” alt=”Loading…” />’,
padding: 0,
nextSelector: ‘.pagination + li a’,
contentSelector: ‘div.infinite-scroll’,
callback: function() {

Also apply “infinite-scroll” class on the foreach loop

<\div class=”infinite-scroll”>
@foreach ($products as $item)
— —




Resource in laravel


In Edit form you have to add <input type=”hidden” name=”_method” value=”put” /> after form tag

Method Patch can you when need to update only single value

Verb          Path                        Action  Route Name
GET           /users                      index   users.index
GET           /users/create               create  users.create
POST          /users                      store
GET           /users/{user}               show
GET           /users/{user}/edit          edit    users.edit
PUT|PATCH     /users/{user}               update  users.update
DELETE        /users/{user}               destroy users.destroy


  1. Difference between static and dynamic function in php oops

2.What is constant and defined in php

3. Laravel event

4. Laravel store processor


user table -> cv table
company tabel -> company_user table

find the company which user has cv

6. jquery jsone.parse and other

7. jquery crose browser request error

8. function((array)$a,(string)$b){ }

9. function overloading and overwriting

10. static function

11. trait class

telephonic round questions

inheritance : normal inherit or call parent class property to child
encapsulation : Public , Private(only defined class can user), Protected (only child class can use) (access modifier)
polymorphic : simply assigning the value and behavior in sub class which is already defined

friend function : are function which defined in class and allow to access all public/ privet data in class
abstract class : which can not be initiate and creating object is not possible it can only inherited

interface : collection of abstract method

traits : allow multiple inheritance and Traits class over ride the extended class methord


service provider : is a class where all laravel bootstraped
larvel equivalent : way to interference database like : equivalent meaning creating object of a method and run some save and update etc funtionliy on this
constructor : core set of instrcation which service provide by laravel like mail,query

Basic questions

Laravel database table naming convention :

Laravel’s naming convention for pivot tables is singularized table names in alphabetical order separated by an underscore. So, if one table is features, and the other table is products, the pivot table will be feature_product.

You are free to use any table name you want (such as product_feature), but you will then need to specify the name of the pivot table in the relationship. This is done using the second parameter to the belongsToMany() function.


What is cUrl?

client url, curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).

curl uses libcurl


What is SOAP?

Simple Object Access Protocol | platform independent |based on XML

SOAP allows you to build interoperable software and allows others to take advantage of your software over a network. It defines rules for sending and receiving Remote Procedure Calls (RPC) such as the structure of the request and responses.

someone can formulate and parse a SOAP message in their chosen language

SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.

SOAP use in web service


File Handling

$myfile = fopen(“webdictionary.txt”, “r”) or die(“Unable to open file!”);
echo fread($myfile,filesize(“webdictionary.txt”));

r : Open a file for read only.
w : Open a file for write only.
a : Open a file for write only.
a : new file if the file doesn’t
x : Creates a new file for write only
r+ : Open a file for read/write
w+ : Open a file for read/write
a+ : Open a file for read/write
x+ : Creates a new file for read/wright

What is Cookie?

A cookie is a small file with the maximum size of 4KB that the web server stores on the client computer. cookies are part of the HTTP request and response headers


setcookie(cookie_name, cookie_value, [expiry_time], [cookie_path], [domain], [secure], [httponly]);


expiry_time : time() + 3600 for 1 hour

session_destroy() = entire session

uset($_SESSION[‘name]) = fix session variable deleted.


What is mySQL engine

Storage engines are MySQL components that handle the SQL operations for different table types. MySQL uses a pluggable storage engine architecture that enables storage engines to be loaded into and unloaded from a running MySQL server.

InnoDB is a storage engine for the database management system MySQL. MySQL 5.5 and later use it by default

Percona XtraDB is a storage engine for the MariaDB and Percona Server databases, and is intended as a drop-in replacement to InnoDB, which is one of the default engines available on the MySQL database


Type off array in php?

In PHP, there are three types of arrays: Indexed arrays – Arrays with numeric index. Associative arrays – Arrays with named keys. Multidimensional arrays – Arrays containing one or more arrays.


for 3+ experience

How session data is store on server
session expire time
chache expire time
set session time
what is data base collection, utf8_genral_ci, uf8_md
array sum
delete some key value from array.. last .. 2nd last.. with function without function
adding any string in array..end


N’th height sallary if some values are same in table sallary collom
$a=’1′, $b=2
if i remove last i++ from “for” loop, than how many time for loop will run
find april data entry from table if date is added in “Y-m-d h:i:s” formate.. with month function and without month function
what route do in laravel
if you want to redirect admin or user module.. how route will set


what is jQuery
right join real life example
any in sql

Setup Laravel 5.x with Admin Panel by Boilerpate

Go to link GitHub – rappasoft/laravel-5-boilerplate: A Laravel 5 Boilerplate Project –

Download setup an extract folder in your local repository

Open setup folder in CMD

Run Command : update composer

Open “Sublime Text” editer or any other editer, Open file .env.example from root directry “save as” file with name “.env”

open .env file Change:

Than in CMD run command : PHP artisan migrate
Output will be :

C:\xampp\htdocs\blog>php artisan migrate
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2015_12_28_171741_create_social_logins_table
Migrated: 2015_12_28_171741_create_social_logins_table
Migrating: 2015_12_29_015055_setup_access_tables
Migrated: 2015_12_29_015055_setup_access_tables
Migrating: 2016_07_03_062439_create_history_tables
Migrated: 2016_07_03_062439_create_history_tables
Migrating: 2017_04_04_131153_create_sessions_table
Migrated: 2017_04_04_131153_create_sessions_table

Than run next Command :php artisan db:seed
The output will be like this:
C:\xampp\htdocs\blog>php artisan db:seed
Seeding: AccessTableSeeder
Seeding: UserTableSeeder
Seeding: RoleTableSeeder
Seeding: UserRoleSeeder
Seeding: PermissionTableSeeder
Seeding: PermissionRoleSeeder
Seeding: HistoryTypeTableSeeder

Check your DB, you will find all tables Now your setup ready to work
login to admin panel : and password : 1234

For more info regarding login go to \database\seeds\Access\UserTableSeeder.php file you can change user name here.


Question : When we have booking date (start date to end date) in db booking table and need to search from “from date” to ” to date” by search box for available seats.

booking table :

id name start_date end_date
1 a 23-06-2017 29-06-2017

here we need 4 condition to check to do not get in between those dates

Example : Search date can be those

1. 24-06-2017 to 25-06-2017

2. 22-06-2017 to 30-06-2017

3. 22-06-2017 to 24-06-2017

4. 25-06-2017 to 31-06-2017

Now Laravel Query :

$booking_arr = DB::table(‘booking’)
->whereRaw(“((booking.start_date <= ‘”.$start_date.”‘ AND booking.end_date > ‘”.$start_date.”‘) OR (booking.start_date < ‘”.$end_date.”‘ AND booking.end_date >= ‘”.$end_date.”‘) OR (booking.start_date >= ‘”.$start_date.”‘ AND booking.start_date <= ‘”.$end_date.”‘))”)
->whereIn(‘category_campsite_id’, $campsites_categories)