Restful api is very useful today while creating a mobile application or web application. Restful api or Http request methods There is 4 types of method of http request. Post Get Put Delete Patch 1. Post method Post method is widely used to fetch the content of a form or…
Category: Php
How to enable cors in web api php or laravel?
Cross-Origin Resource Sharing (CORS) is mechanism which allow browser to share the resources between the other domain or port. if the cors is disabled in api or server then other domain can’t access the apis and resource of server. Example: if a server A wants to access the apis of server…
How to get folder paths using helpers in laravel?
Laravel has helpers to get folder paths using helpers in laravel and by which we can easily get root folder, public folder, assets folder, storage folder, app folder etc. Laravel has helpers to get the path of root folder, public folder, assets folder, storage folder, app folder. To get the…
How to increase maximum file upload size in php ?
Php is the most used language in web. sometimes it required to upload the files which is greater then 2 mb. In php default upload size is 2 mb and if we wanted to increase it then we have multiple ways to change the size of uploading. 1. Change from…
How to find php.ini file location ?
Sometime we installed multiple version of php on our system so it will get difficult to find php.ini file location . Let’s start with easiest way. Steps to find the php ini file on dedicated, localhost and ssh based enabled server. Then run this file in browser. As we can…
3 Ways to Remove public from URL in Laravel
Laravel comes with default server for local environment and but if run the application in apache then we need to remove the public from URL because if we serve the application through the Apache then we need to call the URLs from public directory. It can be multiple way to…
Laravel artisan command to generate controllers, Model, Components and Migrations
Laravel is robust framework of php which provides rapid development and security for low and high level projects. It have many features like Laravel Components, Validation, eloquent, migrations, artisnan security etc. Let’s have look artisan commands of laravel artisan. There is a command which gives you list of all available…
What is Access Modifiers ?
In object oriented programming(oops) to set the visibility of classes, variables and methods we are using access modifiers. So Access modifiers are used the encapsulation of class properties. There are three types of access modifiers in any language (Php, java or c etc. ) Private Protected Public 1. Private Access…
What is a traits in PHP and how to use it ?
Before PHP 5.4, there was no way to implement multiple inheritance in PHP then PHP 5.4 introduce traits as a substitute of multiple inheritance in PHP. By using the traits PHP solve the problem of Multiple Inheritance. A class only extend one class what if we wanted to use multiple…
What is static keyword and properties in a php/java class?
Static keyword are isolated, which means we can access the property of a class without creating a object/instance of class. static methods that are common to all the objects of the class. Hence, any logic which can be shared among multiple instances of a class should be inside the static…