SlideShare uma empresa Scribd logo
1 de 22
10 Laravel packages
everyone should know
Povilas Korop • Laravel Vilnius Meetup • 2015-10-29
1.Carbon
A simple PHP API extension
for DateTime.
http://carbon.nesbot.com/
https://github.com/briannesbitt/Carbon
Not specifically for Laravel
But part of Laravel out-of-the-box
Carbon examples
$user->created_at->format(‘H:i’);
$tomorrow = Carbon::now('Europe/Vilnius')->addDay();
$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age;
if (Carbon::now()->isWeekend()) {
echo 'Party!';
}
Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes
ago'
2. illuminate/html
Subtree split of the Illuminate
HTML component.
https://github.com/illuminate/html
Internal part until Laravel 4 version
Mostly for Form:: facade
Illuminate/html examples
{!! Form::open(array('route' => 'admins.store' )) !!}
{!! Form::label('name', 'Name:') !!}
{!! Form::text('name', old('name'),
['placeholder'=> 'Name', 'required']) !!}
{!! Form::submit('Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
3. Laravel-4-Generators
(+ Laravel-5-Generators-Extended)
Speed up your Laravel
workflow with generators.
https://github.com/JeffreyWay/Laravel-4-
Generators
https://github.com/laracasts/Laravel-5-
Generators-Extended
Author: Jeffrey Way from Laracasts
More useful in Laravel 4 version
Generators examples
Laravel 4:
php artisan generate:migration add_user_id_to_posts_table
php artisan generate:model Post
php artisan generate:view admin.reports.index
Laravel 5:
php artisan make:migration:schema create_users_table
--schema="username:string, email:string:unique"
php artisan make:migration:pivot tags posts
php artisan make:seed posts
4. doctrine/dbal
Database Abstraction Layer
https://github.com/doctrine/dbal
From the docs:
Before modifying a column, be sure to add
the doctrine/dbal dependency to your
composer.json file. The Doctrine DBAL
library is used to determine the current
state of the column and create the SQL
queries needed to make the specified
adjustments to the column.
Not specifically for Laravel
Used for specific database operations
Doctrine/dbal examples
Schema::table('users', function ($table) {
$table->string('name', 50)->change();
});
Schema::table('users', function ($table) {
$table->renameColumn('name', 'username');
});
5. intervention/image
Image handling and
manipulation library
http://image.intervention.io/
https://github.com/Intervention/image
Not specifically for Laravel
GD Library or Imagick PHP extension
Intervention/image examples
$img = Image::make('foo.jpg')->resize(300, 200);
$img->insert('public/watermark.png');
return $img->response('jpg');
$image = Input::file('image');
$filename = time() . '.' . $image->getClientOriginalExtension();
$path = public_path(‘images/' . $filename);
Image::make($image->getRealPath())
->resize(200, 200)->save($path);
6. jenssegers/agent
A PHP desktop/mobile user
agent parser with support for
Laravel
https://github.com/jenssegers/agent
Based on serbanghita/Mobile-Detect
jenssegers/agent examples
use JenssegersAgentAgent;
$agent = new Agent();
if ($agent->is('Windows')) // ...
if ($agent->is('Firefox')) // ...
if ($agent->isMobile()) // ...
if ($agent->isTablet()) // ...
$agent->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X
10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7
Safari/534.57.2');
$agent->setHttpHeaders($headers);
7. barryvdh/laravel-dompdf
DOMPDF Wrapper for Laravel
5
https://github.com/barryvdh/laravel-dompdf
Based on dompdf/dompdf
For L4: try thujohn/pdf-l4
laravel-dompdf examples
$pdf = App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1>');
return $pdf->stream();
$pdf = PDF::loadView('pdf.invoice', $data);
return $pdf->download('invoice.pdf');
PDF::loadHTML($html)
->setPaper('a4')
->setOrientation('landscape')
->setWarnings(false)
->save('myfile.pdf');
8. cviebrock/eloquent-sluggable
Easy creation of slugs for your
Eloquent models in Laravel
https://github.com/cviebrock/eloquent-sluggable
Versions 3.x - for Laravel 5
Versions 2.x - for Laravel 4
eloquent-sluggable examples
php artisan sluggable:table posts slug_column
$post = Post::create(['title' => 'My Awesome Blog Post']);
echo $post->slug;
echo $post->getSlug();
Config:
'build_from' => null,
'save_to' => 'slug',
'max_length' => null,
'method' => null,
'separator' => '-',
'unique' => true,
...
9. barryvdh/laravel-ide-helper
Laravel 5 IDE Helper
Generator
https://github.com/barryvdh/laravel-ide-helper
Also available as generated Gist
Needs doctrine/dbal for DB columns
Great explanation in Laracasts:
https://laracasts.com/series/how-to-
be-awesome-in-
phpstorm/episodes/15
laravel-ide-helper examples
10. barryvdh/laravel-debugbar
Laravel Debugbar
https://github.com/barryvdh/laravel-debugbar
Same author as IDE Helper:
Barry van den Heuvel
Integrates PHP Debug Bar
Don’t forget to turn off on production!
laravel-debugbar examples
Anything I’ve missed?
Or questions?

Mais conteúdo relacionado

Mais procurados

Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
 

Mais procurados (20)

All Aboard for Laravel 5.1
All Aboard for Laravel 5.1All Aboard for Laravel 5.1
All Aboard for Laravel 5.1
 
Laravel for Web Artisans
Laravel for Web ArtisansLaravel for Web Artisans
Laravel for Web Artisans
 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Laravel 5 New Features
Laravel 5 New FeaturesLaravel 5 New Features
Laravel 5 New Features
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to Laravel
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
 
Laravel 5.4
Laravel 5.4 Laravel 5.4
Laravel 5.4
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
A introduction to Laravel framework
A introduction to Laravel frameworkA introduction to Laravel framework
A introduction to Laravel framework
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
 
Hack the Future
Hack the FutureHack the Future
Hack the Future
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 

Destaque

Destaque (8)

Fresh Laravel packages - September 2016
Fresh Laravel packages - September 2016Fresh Laravel packages - September 2016
Fresh Laravel packages - September 2016
 
10 less-known Laravel Packages: April 2016
10 less-known Laravel Packages: April 201610 less-known Laravel Packages: April 2016
10 less-known Laravel Packages: April 2016
 
10 Fresh laravel packages - October 2016
10 Fresh laravel packages - October 201610 Fresh laravel packages - October 2016
10 Fresh laravel packages - October 2016
 
10 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 201610 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 2016
 
Laravel Code Generators and Packages
Laravel Code Generators and PackagesLaravel Code Generators and Packages
Laravel Code Generators and Packages
 
From Laravel Developer to Manager: Tools, Tips and Processes
From Laravel Developer to Manager: Tools, Tips and ProcessesFrom Laravel Developer to Manager: Tools, Tips and Processes
From Laravel Developer to Manager: Tools, Tips and Processes
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill Sparks
 
Models for hierarchical data
Models for hierarchical dataModels for hierarchical data
Models for hierarchical data
 

Semelhante a 10 Laravel packages everyone should know

Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
Clinton Dreisbach
 
Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
Cameron Eagans
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
James Williams
 
Services web RESTful
Services web RESTfulServices web RESTful
Services web RESTful
goldoraf
 

Semelhante a 10 Laravel packages everyone should know (20)

Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Core Android
Core AndroidCore Android
Core Android
 
Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration Tools
 
Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to you
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13
 
Oracle APEX & PhoneGap
Oracle APEX & PhoneGapOracle APEX & PhoneGap
Oracle APEX & PhoneGap
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Teaching Your WAF New Tricks
Teaching Your WAF New TricksTeaching Your WAF New Tricks
Teaching Your WAF New Tricks
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 
Services web RESTful
Services web RESTfulServices web RESTful
Services web RESTful
 
Puppet at Pinterest
Puppet at PinterestPuppet at Pinterest
Puppet at Pinterest
 

Último

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Último (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 

10 Laravel packages everyone should know

  • 1. 10 Laravel packages everyone should know Povilas Korop • Laravel Vilnius Meetup • 2015-10-29
  • 2. 1.Carbon A simple PHP API extension for DateTime. http://carbon.nesbot.com/ https://github.com/briannesbitt/Carbon Not specifically for Laravel But part of Laravel out-of-the-box
  • 3. Carbon examples $user->created_at->format(‘H:i’); $tomorrow = Carbon::now('Europe/Vilnius')->addDay(); $howOldAmI = Carbon::createFromDate(1975, 5, 21)->age; if (Carbon::now()->isWeekend()) { echo 'Party!'; } Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago'
  • 4. 2. illuminate/html Subtree split of the Illuminate HTML component. https://github.com/illuminate/html Internal part until Laravel 4 version Mostly for Form:: facade
  • 5. Illuminate/html examples {!! Form::open(array('route' => 'admins.store' )) !!} {!! Form::label('name', 'Name:') !!} {!! Form::text('name', old('name'), ['placeholder'=> 'Name', 'required']) !!} {!! Form::submit('Create', ['class' => 'btn btn-primary']) !!} {!! Form::close() !!}
  • 6. 3. Laravel-4-Generators (+ Laravel-5-Generators-Extended) Speed up your Laravel workflow with generators. https://github.com/JeffreyWay/Laravel-4- Generators https://github.com/laracasts/Laravel-5- Generators-Extended Author: Jeffrey Way from Laracasts More useful in Laravel 4 version
  • 7. Generators examples Laravel 4: php artisan generate:migration add_user_id_to_posts_table php artisan generate:model Post php artisan generate:view admin.reports.index Laravel 5: php artisan make:migration:schema create_users_table --schema="username:string, email:string:unique" php artisan make:migration:pivot tags posts php artisan make:seed posts
  • 8. 4. doctrine/dbal Database Abstraction Layer https://github.com/doctrine/dbal From the docs: Before modifying a column, be sure to add the doctrine/dbal dependency to your composer.json file. The Doctrine DBAL library is used to determine the current state of the column and create the SQL queries needed to make the specified adjustments to the column. Not specifically for Laravel Used for specific database operations
  • 9. Doctrine/dbal examples Schema::table('users', function ($table) { $table->string('name', 50)->change(); }); Schema::table('users', function ($table) { $table->renameColumn('name', 'username'); });
  • 10. 5. intervention/image Image handling and manipulation library http://image.intervention.io/ https://github.com/Intervention/image Not specifically for Laravel GD Library or Imagick PHP extension
  • 11. Intervention/image examples $img = Image::make('foo.jpg')->resize(300, 200); $img->insert('public/watermark.png'); return $img->response('jpg'); $image = Input::file('image'); $filename = time() . '.' . $image->getClientOriginalExtension(); $path = public_path(‘images/' . $filename); Image::make($image->getRealPath()) ->resize(200, 200)->save($path);
  • 12. 6. jenssegers/agent A PHP desktop/mobile user agent parser with support for Laravel https://github.com/jenssegers/agent Based on serbanghita/Mobile-Detect
  • 13. jenssegers/agent examples use JenssegersAgentAgent; $agent = new Agent(); if ($agent->is('Windows')) // ... if ($agent->is('Firefox')) // ... if ($agent->isMobile()) // ... if ($agent->isTablet()) // ... $agent->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2'); $agent->setHttpHeaders($headers);
  • 14. 7. barryvdh/laravel-dompdf DOMPDF Wrapper for Laravel 5 https://github.com/barryvdh/laravel-dompdf Based on dompdf/dompdf For L4: try thujohn/pdf-l4
  • 15. laravel-dompdf examples $pdf = App::make('dompdf.wrapper'); $pdf->loadHTML('<h1>Test</h1>'); return $pdf->stream(); $pdf = PDF::loadView('pdf.invoice', $data); return $pdf->download('invoice.pdf'); PDF::loadHTML($html) ->setPaper('a4') ->setOrientation('landscape') ->setWarnings(false) ->save('myfile.pdf');
  • 16. 8. cviebrock/eloquent-sluggable Easy creation of slugs for your Eloquent models in Laravel https://github.com/cviebrock/eloquent-sluggable Versions 3.x - for Laravel 5 Versions 2.x - for Laravel 4
  • 17. eloquent-sluggable examples php artisan sluggable:table posts slug_column $post = Post::create(['title' => 'My Awesome Blog Post']); echo $post->slug; echo $post->getSlug(); Config: 'build_from' => null, 'save_to' => 'slug', 'max_length' => null, 'method' => null, 'separator' => '-', 'unique' => true, ...
  • 18. 9. barryvdh/laravel-ide-helper Laravel 5 IDE Helper Generator https://github.com/barryvdh/laravel-ide-helper Also available as generated Gist Needs doctrine/dbal for DB columns Great explanation in Laracasts: https://laracasts.com/series/how-to- be-awesome-in- phpstorm/episodes/15
  • 20. 10. barryvdh/laravel-debugbar Laravel Debugbar https://github.com/barryvdh/laravel-debugbar Same author as IDE Helper: Barry van den Heuvel Integrates PHP Debug Bar Don’t forget to turn off on production!