Case 1: PHPStorm Laravel Configuration
PHPStrom is considered one of the famous and most commonly used IDE for PHP developers beside NetBeans and Sublime.
We can take the full advantage of this IDE when creating Web Applications using Laravel PHP Framework.
As a default PHPStorm is not shipped with Laravel features support or plugin installed.
In this article I am going to show you how to install Laravel pluggin for PHPStorm after downloading
Barry vd. Heuvel code in two main steps.
Notice that this article assumes that you already had installed the required package to run a Laravel project on your local server like composer and Laravel files,
if you need more information you can visit Laravel Installation page.
Stage 1:
Step 1:
In your CMD and by using composer, copy the following line from barryvdh's GitHub page and paste it into the command prompt, or just type it:
composer require barryvdh/laravel-ide-helper
You can also use PHPStorm Terminal window (at the bottom of the IDE) to run the composer or Laravel Artisan commands
Step 2:
After creating a new PHP project (contains the initial Laravel folders and files), copy the following line of code from the same page:
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
Then using PHPStorm you need to navigate to the wanted file:
Project Root >> config >> app.php
After opening the app.php file, search for providers array:
'providers' => [...
paste your copied line after 'Illuminate\View\ViewServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class',
Step 3:
using CMD or PHPStorm window run the command:
php artisan ide-helper:generate
Stage 2:
After finishing all the steps in stage 1, you should be ready to install Laravel 5 plug-in
Goto to File Menu >> Settings (CTRL+ALT+S for new PHPStrom versions or Alt+F7 for old versions):
From the left pane select Plugins category, then in the search box search for laravel
you will see Laravel Plugin highlighted, you can click install now, and then Restart the IDE to complete the installation of the plugin
For more details you can visit
Laravel Development using PhpStorm
Case 2: CodeIgniter (Removing index file)
When using CI (PHP Framework), you will notice that CI includes index.php in the URL for any link to any file. When you search for this issue by typing: “ci remove index.php from url”, you will see the link to
Ellislab user guide that describes how to fix or solve this issue as shown in the image below:
Now the explanation is very simple and clear, but unfortunately is not complete! In this post I will try to show you what I did to get my project links to work without including index.php in the URL.
Step1:
When you first install CI, you will notice the .htaccess file is inside sub folder called “Application”. You need to move it (.htaccess) to the root folder of your project. For example, if your CI website is inside a sub folder named “myproject”: www.mywebsite.com/myproject, .httaccess has to be inside myprojet folder (directory).
Step2:
Open .htaccess, clear it then write the following code:
RewriteEngine On
RewriteBase /myproject/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
ErrorDocument 404 /index.php
Notice that in the second line of the code, the CI website name is myproject. You need to change it based on your project root folder name.
Step 3:
Open config.php file here is the path for this file:
Myproject/application/config/config.php
First:
You will see the following comment plus $config['base_url']
// the config[base url] file is the root folder name and anything
before that:
Change the value of $config['base_url'] to:
For localhost (on your pc):
$config['base_url'] =
‘http://localhost/myproject/’;
For your online server:
$config['base_url'] = ‘http://www.mydomain.com/myproject/’;
Second:
In the same file (config.php), you will see the line: $config['index_page']
= ‘index.php’;
Remove the index.php as shown below:
$config['index_page'] = ”;
Step4:
I assume you have your main navigation links inside php template file
named header, navigation, or any name you chose. You need to change
the links in your main nav to look like this:
<li><a href=”<?php echo base_url();?>mainsite/home”>home</a></li>
mainsite is your main controller name
home is the function
name inside your mainsite controller that load home page from the
view folder