- Laravel packages
- Testing
- Server Tools
- Markdown
- Laravel Homestead
- Setup Laravel 4 in a Shared Hosting with securing Laravel base file
- Laravel Application Environments
- Install ImageMagick
- Hooking up a custom domain name to DigitalOcean
- Laravel Repository (IoC)
- Testing in Laravel
- Front stuff
- Laravel Books
- Cloud Hosting Services
- Git Hosting Services
- Online Playgrounds
- Other
- Localization
- Excel and CSV
- DOM PDF
- Sitemap
- Robots
- Intervention Image
- Glu Image
- Shopping Cart
- PayPal Payment
- Sass
- Eloquent Sluggable
- Markdown parser
- HTML DOM parser
- RSS Feed
- User Agent
- Gravatar
- Data sanitizer
- Google Analytics API
- Google reCAPTCHA
- No CAPTCHA reCAPTCHA
- All Bar-code generator
- OAuth wrapper
- Social Networks
- Carbon (date)
- Menu
- Image Validator Rules
- CSS and JS Minifier
- Scraping
- Calendar
- HTML5 Forms
- JSON API
- ACL
- HTML Minify
- Minify
- Zipper
- Visitor tracker
- BrainSocket
- Searchable
- MailChimp Laravel
- MailChimp Class
- Laravel DB Backup
- Laravel 4 Generators (by @jeffrey_way)
- Auto-Validate On Save (by @jeffrey_way)
- Laravel Administrator Documentation
- Aftership
- UPS webservice
- Ultimate Package Installer
- Simple CDN
- CloudFlare
- Bootstrap CMS
- OctoberCMS
- Multilingual models
- Intervention image cache
- Image Glide
- Theme organizer
- Form builder
- Authentication & Authorization System
- Asset pipeline
- Laravel MongoDB
- Laravel IP Service
- Countries
- PHPUnit
- Codeception
- Mockery
- Behat
- Faker
- PHP Parallel Lint
- PHP_CodeSniffer
- Laravel PHP_CodeSniffer
- PHP Mess Detector
- Kint (PHP Debug tool)
- Semantic Versioning
- Clockwork
- Search
- Vagrant
- Travis Continuous Integration
- Coveralls (Code Coverage)
- nginx docs
- Increase file upload size limit in Nginx
- Bowery
# 1. install Vagrant and VirtualBox
# https://www.vagrantup.com/
# https://www.virtualbox.org/
# 2. add homestad box into vagrant
$ vagrant box add laravel/homestead
# 3. create Code folder
$ mkdir Code
$ cd Code
# 4. clone the homestead repository
$ git clone https://github.com/laravel/homestead.git homestead
# 5. prepare your yaml config file
$ cd homestead
$ vim Homestead.yaml
# 6. if you haven't, create your keys (this will be used in authorize and keys in the yaml file) (optional)
$ ssh-keygen -t rsa -C "your@email.com"
# 7. update your hosts file with your custom url
$ sudo vi /etc/hosts
# 8. start your virtual machine in the homestead folder
$ vagrant up
#################
# OTHER ACTIONS #
#################
# visit the website: http://example.app:8000/
# enter the VM in the homestead folder
$ vagrant ssh
# suspend the VM before turning off your computer
$ vagrant suspend
# and then you can do "vagrant up" to use the VM again
# to reload the VM in the homestead folder
$ vagrant reload
# to add a virtual host into homestead VM
## Easy method
$ vagrant reload --provision
## Advanced method
$ vagrant ssh
$ serve new-domain.app /home/vagrant/Code/path/to/public/directory
# to update the version of homestead
$ vagrant box update
# create a new laravel project
$ composer create-project laravel/laravel <project-name>
# create a new laravel project with a custom version
$ composer create-project laravel/laravel=4.2.* <project-name> --prefer-dist
# change permissions of storage folder
$ sudo chmod -R 777 app/storage
# play with artisan, so we don't have to create/edit php files
$ php artisan tinker
# copy the ssh public key
$ pbcopy < ~/.ssh/id_rsa.pub
# 0. This assume that you have file structure something like this:
/home/username/public_html
# 1. Create new folder outside public_html:
/home/username/main-laravel
# 2. Move all the main file of Laravel (app, boostrap, vendor, composer.json, composer.lock, phpunit.xml etc) into that folder (step 1) **except Public folder
# 3. Open /home/username/main-laravel/bootstrap/paths.php and edit to look like this:
## replace
'app' => __DIR__.'/../app',
'public' => __DIR__.'/../public',
'base' => __DIR__.'/..',
'storage' => __DIR__.'/../app/storage',
## to
'app' => __DIR__.'/../../main-laravel/app',
'public' => __DIR__.'/../../public_html/laravel',
'base' => __DIR__.'/../../main-laravel',
'storage' => __DIR__.'/../../main-laravel/app/storage',
# 4. Now create a new folder inside public_html
/home/username/public_html/laravel
# 5. Now, move all the content in public folder of Laravel into that folder (step 4)
# 6. Open /home/username/public_html/laravel/index.php and edit to look like this:
## replace
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
## to
require __DIR__.'/../../main-laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../main-laravel/bootstrap/start.php';
# 7. Now create .htaccess in /home/username/public_html and insert this code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^laravel
RewriteRule ^(.*)$ laravel/$1 [L]
# Now, your laravel website can be access at http://username.com
$env = $app->detectEnvironment( function ()
{
return getenv('APP_ENV') ?: 'development';
});
<?php
return [
'DB_PASSWORD' => 'secret password'
];
// add this file to .gitignore
// .env.php has the production environemnt keys (it exists only in production)
// (if the hosting can't define env vars, this should be the way)
getenv('DB_PASSWORD');
Just ssh into your vm, then install the required packages, like so:
vagrant ssh
sudo apt-get update
sudo apt-get install imagemagick
sudo apt-get install php5-imagick
Hostname | Record Type | Value |
---|---|---|
@ | A | [ip-address] |
-
| A | [ip-address]
www | CNAME | [url-address]
- The main domain (it can be the alias).
- An alias to point every subdomain to the ip-address.
- Point a subdomain to the main domain.
- Go to https://cloud.digitalocean.com/domains
- Click on “Add Domain”
- Add the domain in the “Name” field
- Add the IP in the “IP Address” field
- Select the droplet where you have that domain with that IP address
- Click on “CREATE DOMAIN”, and that's it.
- Then add the DigitalOcean DNS in your domain provider DNS config
ns1.digitalocean.com
ns1.digitalocean.com
ns1.digitalocean.com
<?php namespace Acme;
interface LessonRepositoryInterface {
public function recent();
}
<?php namespace Acme;
class DbLessonRepository implements LessonRepositoryInterface {
public function recent()
{
return Lessons::take(5)->orderBy('id', 'desc')->get();
// you can also add this as a method inside the Lessons model
}
}
"autoload": {
"classmap": {
"app/Acme"
}
}
Then do a composer dump
.
<?php
App::bind('Acme\LessonRepositoryInterface', 'Acme\DbLessonRepository');
Route::resource('lessons', 'LessonsController');
<?php
use Acme\LessonRepositoryInterface as LessonRepository;
class LessonsController extends BaseController {
protected $lesson;
public function __construct(LessonRepository $lesson)
{
$this->lesson = $lesson;
}
public function index()
{
return $this->lesson->recent();
}
// ...
}
class ExampleTest extends PHPUnit_Framework_TestCase {
// use only PHPUnit for business logic
}
class ExampleTest extends TestCase {
// use complete Laravel TestCase logic
}
<?php
class ExampleTest extends TestCase {
public function test_displays_home_page()
{
$this->call('GET', '/');
$this->see('Hello world', 'h1');
}
protected function see($text, $element = 'body')
{
$crawler = $this->client->getCrawler();
$found = $crawler->filter("{$element}:contains('{$text}')");
$this->assertGreaterThan(0, count($found), "Expected to see {$text} within the view");
}
}
<?php
class LessonsControllerTest extends TestCase {
public function setUp()
{
parent::setUp();
// prepare the repository mock for use in every controller test
$this->lesson = Mockery::mock('Acme\LessonRepositoryInterface');
App::instance('Acme\LessonRepositoryInterface', $this->lesson);
}
public function tearDown()
{
Mockery::close();
}
public function test_binds_lessons_to_index_view()
{
$this->lesson->shouldReceive('recent')->once()->andReturn('foo');
$result = $this->call('GET', '/lessons');
$this->assertEquals('foo', $result->getContent());
}
}
You can add a configuration file in app/config/testing/database.php
:
<?php
return [
'default' => 'sqlite',
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => ':memory',
'prefix' => '',
)
)
];
And then create an example test that uses a test database in memory:
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
}
public function test_it_works()
{
// in orther for this test to work
// we have to create an Order model and its migration :)
Order::create(['name' => 'Wii U']);
$this->assertsEquals('Wii U', Order::first()->name);
}
}
- Bootstrap
- Font Awesome
- Icons8
- Input Mask
- Time Picker
- Date Picker
- Date Range Picker
- iCheck
- Color Picker
- wysihtml5
- MixItUp
- Graphs
- Favicons, Touch Icons, Tile Icons, etc. What All Do You Need?
- skrollr
- Live pixel check
- Google Noto Font
- Brand Colors
- Meteor.js
- jQuery Countdown
- SpinKit (Spinner)
- Squire - HTML5 rich text editor
- Laravel: Code Bright
- Laravel Testing Decoded
- Laravel: From Apprentice To Artisan
- Laravel 4 Cookbook
- Laravel: Code Happy
- Implementing Laravel
- Laravel - my first framework
- DigitalOcean
- Heroku
- Linode
- Google Cloud Platform
- Amazon Web Services (AWS)
- Engine Yard
- New Relic
- Rackspace
- DreamHost
- CloudFlare (CDN)
- Pagoda Box
- fortrabbit
- Hover - Domain management
- Defining Your Own Helper Classes in Laravel 4
- PHP The “Right” Way
- Runnable
- Rebuilding Laravel
- Laravel Schema Designer
- Priss - Print CSS
- Gzip Compression Test
- Laravel Bash Aliases
- TinyPNG
- Display validation errors without using Sessions (useful for Facebook-Tab apps)
- Multiple DB Connections in Laravel
- Design Patterns
- RegExr
- Free invoice generator
- The Invoice Machine
- Getting started with Laravel 4
- Mobile icons and screens generator
- Social networks development
- Speed Up Your Website using Caching and .htaccess
- Distributing iOS Apps With iTunes Connect
- Survey Monkey
- Exploring The Travis-CI Configuration File
- Android Asset Studio
- Free HTML To PDF Converter