- 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'
- 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() !!}
- Laravel-4-Generators (+ Laravel-5-Generators-Extended) Speed up your Laravel workflow with generators. Laravel 5 Generator || Laravel 5 Generator 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
- 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');
});
- 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);
- 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);
- 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');
- 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, ...
- 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
- 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
Ref Link: http://www.slideshare.net/povilask007/10-laravel-packages-everyone-should-know