Category: Laravel

Jun 30

Configure Mac OsX for Laravel Development with Valet

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” brew update brew install homebrew/php/php71 composer global require laravel/valet export PATH=$PATH:~/.composer/vendor/bin — not required curl -sS https://getcomposer.org/installer | php curl https://getcomposer.org/installer | php — php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);” php -r “if (hash_file(‘SHA384’, ‘composer-setup.php’) === ‘669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;” php …

Continue reading

Jun 30

Forge: Painless Server Management including Digital Ocean and AWS

PAINLESS SERVER MANAGEMENT. Sure, you can do all of these on your Own in platforms like AWS or Digital Ocean. However, Forge has made them easy and user friendly (you do not have to be an expert on Linux or so) Numerous Cloud Providers Choose between AWS, Digital Ocean, Linode, or even your own custom …

Continue reading

Jun 30

Envoyer: Zero Downtime PHP application Deployment

Zero Downtime PHP Deployment – Laravel application deployment Deployments you’ve only dreamed about. Zero downtime. Zero fuss. https://laracasts.com/series/envoyer/episodes/1

Jan 07

Introduction to Laravel View

Jan 07

Laravel Localization

Jan 03

Introduction to Laravel View

Dec 24

Miscellaneous concepts and libraries for Laravel based development

Miscellaneous concepts and libraries for Laravel based development      

Continue reading

Dec 22

Misc Laravel Resources

Laravel on GitHub : https://github.com/laravel/laravel Laravel releases: Latest release is 5.3.16 (released on Oct 2nd) https://github.com/laravel/laravel/releases Laravel Development Branches Master: Should be the production ready version Develop : Should be the active development version Stale : Should be the ones – no longer under development and extension Laravel contributors: https://github.com/laravel/laravel/graphs/contributors Be one of them.

Dec 10

Laravel Query Builder (Laravel 5.3)

$users = DB::table(‘users’)->get(); //get all users //returns collections of objects foreach ($users as $user) { echo $user->name; } —   $user = DB::table(‘users’)->where(‘name’, ‘John’)->first(); //first row as an object $email = DB::table(‘users’)->where(‘name’, ‘John’)->value(’email’); //return the values of email column $titles = DB::table(‘roles’)->pluck(‘title’); //array of values — $roles = DB::table(‘roles’)->pluck(‘title’, ‘name’); //custom key foreach ($roles as …

Continue reading

Dec 10

Laravel Application Testing

<?php use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseTransactions; class ExampleTest extends TestCase { /** * A basic functional test example. * * @return void */ public function testBasicExample() { $this->visit(‘/’) ->see(‘Laravel 5’) ->dontSee(‘Rails’); } } — public function testBasicExample() { $this->visit(‘/’) ->click(‘About Us’) ->seePageIs(‘/about-us’); } — Also check: Selenium web-drive: http://www.guru99.com/first-webdriver-script.html

Dec 10

Laravel Testing Databases

public function testDatabase() { // Make call to application… $this->seeInDatabase(‘users’, [ ’email’ => ‘sally@example.com’ ]); } — <?php use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; class ExampleTest extends TestCase { use DatabaseMigrations; /** * A basic functional test example. * * @return void */ public function testBasicExample() { $this->visit(‘/’) ->see(‘Laravel 5’); } }     <?php …

Continue reading

Dec 10

Laravel Mocking, Laravel Testing

<?php use App\Events\UserRegistered; class ExampleTest extends TestCase { /** * Test new user registration. */ public function testUserRegistration() { $this->expectsEvents(UserRegistered::class); // Test user registration… } } — <?php class ExampleTest extends TestCase { public function testUserRegistration() { $this->withoutEvents(); // Test user registration code… } } — <?php use App\Events\OrderShipped; use App\Events\OrderFailedToShip; use Illuminate\Support\Facades\Event; class ExampleTest …

Continue reading

Dec 07

Laravel Query Builder, Cheatsheet

$users = DB::table(‘users’)->get() $user = DB::table(‘users’)->where(‘name’, ‘John’)->first(); $name = DB::table(‘users’)->where(‘name’, ‘John’)->pluck(‘name’); $roles = DB::table(‘roles’)->lists(‘title’); $roles = DB::table(‘roles’)->lists(‘title’, ‘name’); $users = DB::table(‘users’)->select(‘name’, ’email’)->get(); $users = DB::table(‘users’)->distinct()->get(); $users = DB::table(‘users’)->select(‘name as user_name’)->get(); $query = DB::table(‘users’)->select(‘name’); $users = $query->addSelect(‘age’)->get(); $users = DB::table(‘users’)->where(‘votes’, ‘>’, 100)->get(); $users = DB::table(‘users’)->where(‘votes’, ‘>’, 100)->orWhere(‘name’, ‘John’)->get(); $users = DB::table(‘users’)->whereBetween(‘votes’, array(1, 100))->get(); $users = DB::table(‘users’)->whereNotBetween(‘votes’, …

Continue reading

Skip to toolbar