Declaration of TestCase::setUp() must be compatible

If you are getting an error while testing in laravel as  PHP Fatal error: Declaration of Tests\TestCase::setUp() must be compatible with Illuminate\Foundation\Testing\TestCase::setUp():.... in th [...]

VMWare shared folder as apache vhost

Step 1. Find the apache user and group id as id -u apache id -g apache Step 2: open vmware-tools files add apache user to the shared folder as sudo vim /etc/init.d/vmware-tools Step 3: Update [...]

Don't just create the Model, implement Repository Pattern

Think a scenario where your application uses MySQl database, and you need to switch to a different DB,that means are you going to rewrite your database logic again?. Thanks to Laravel Repository Patte [...]

Generate dummy data in Laravel using Model Factory

Here are the steps needed to create dummy data Lets create a model called Sample with migration file, using php artisan command php artisan make:model Sample -m Run the migration byphp artisan [...]

Artisan to generate resource controller

Usage: make:controller [options] [--] <name> Arguments: name The name of the class Options: -m, --model[=MODEL] Generate a resource controller for the given model. -r, --resource Gener [...]

Custom error page in Laravel

Step 1. Create a view resources\views\exceptions\404.blade.php Step 2. Add the following code in App\Exceptions\Handler.php /** * Render an exception into a response. * * @param \Illuminate\Ht [...]

How to install Laravel

We can install Laravel by Laravel Installer or through composer. Laravel Installer First we have to download the Laravel Installer.In order to do that open your terminal and type composer g [...]

How to install composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Windows Installer The instal [...]

How to create a virtual host

There are two ways you can create your virtual hosts easily. Through command prompt using ssh If you have already installed the vagrant box, then open your bash command window or putty type [...]

Creating Test Environment for Laravel using Fedora 21

For this environment we will use vagrant to import boxcutter/fedora21 box . Here are the steps Install vagrant if you have not installed yet. You can download it from [...]