4
4
< meta charset ="UTF-8 ">
5
5
< link rel ="shortcut icon " href ="assets/ico/favicon.png ">
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7
- < meta name ="author " content ="@aufree ">
7
+ < meta name ="author " content ="@summer ">
8
8
< title > Laravel 5.1 LTS Cheat Sheet</ title >
9
9
< meta name ="description " content ="A quick reference guide (cheat sheet) for Laravel 5.1 LTS, listing artisan, composer, routes and other useful bits of information.We intend to build this Cheat Sheet more assessable and user friendly, you can view it with modern desktop :computer: browser and mobile device :iphone: . ">
10
10
< meta name ="keywords " content ="Laravel 5.1 Artisan,Laravel 5.1 Auth,Laravel 5.1 Blade,Laravel 5.1 Cache,Laravel 5.1 Composer,Laravel 5.1 Config,Laravel 5.1 Container,Laravel 5.1 Cookie,Laravel 5.1 DB,Laravel 5.1 Environment,Laravel 5.1 Event,Laravel 5.1 File,Laravel 5.1 Form,Laravel 5.1 HTML,Laravel 5.1 Helper,Laravel 5.1 Input,Laravel 5.1 Lang,Laravel 5.1 Log,Laravel 5.1 Mail,Laravel 5.1 Model,Laravel 5.1 Pagination,Laravel 5.1 Queue,Laravel 5.1 Redirect,Laravel 5.1 Request,Laravel 5.1 Response,Laravel 5.1 Route,Laravel 5.1 SSH,Laravel 5.1 Schema,Laravel 5.1 Security,Laravel 5.1 Session,Laravel 5.1 String,Laravel 5.1 URL,Laravel 5.1 UnitTest,Laravel 5.1 Validation,Laravel 5.1 View ">
@@ -72,16 +72,16 @@ <h5 class="sidebar-title">Laravel 5.1 LTS Cheat Sheet</h5>
72
72
< a href ="http://estgroupe.com " target ="_blank "> by The EST Group</ a >
73
73
</ li >
74
74
< li class ="social-icon ">
75
- < a href ="http://github.com/aufree " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="This project maintained by Aufree with Love ">
75
+ < a href ="http://github.com/summerblue " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="This project maintained by Summer with Love ">
76
76
< div class ="avatar "> </ div >
77
77
</ a >
78
- < a href ="https://github.com/Aufree /laravel5-cheatsheet " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Star me on GitHub ">
78
+ < a href ="https://github.com/summerblue /laravel5-cheatsheet " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Star me on GitHub ">
79
79
< i class ="icon-github "> </ i >
80
80
</ a >
81
- < a href ="https://twitter.com/_Paul_King_ " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Follow My Twitter ">
81
+ < a href ="https://twitter.com/Summer_Charlie " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Follow My Twitter ">
82
82
< i class ="icon-twitter "> </ i >
83
83
</ a >
84
- < a href ="http://weibo.com/jinfali " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Follow My Weibo ">
84
+ < a href ="http://weibo.com/1837553744 " target ="_blank " data-tooltip aria-haspopup ="true " class ="top " data-disable-hover ="false " tabindex ="2 " title ="Follow My Weibo ">
85
85
< i class ="icon-weibo "> </ i >
86
86
</ a >
87
87
</ li >
@@ -90,7 +90,7 @@ <h5 class="sidebar-title">Laravel 5.1 LTS Cheat Sheet</h5>
90
90
< i class ="cn flag "> </ i >
91
91
</ a >
92
92
< span class ="vertical-line "> |</ span >
93
- < a href ="https://aufree .github.io/laravel5-cheatsheet/ ">
93
+ < a href ="https://summerblue .github.io/laravel5-cheatsheet/ ">
94
94
< i class ="gb flag "> </ i >
95
95
</ a >
96
96
</ li >
@@ -286,7 +286,7 @@ <h4><a name="composer" href="#composer">Composer</a> <a href="http://getcomposer
286
286
composer update
287
287
composer dump-autoload [--optimize]
288
288
composer self-update
289
- composer require [options] [--] [vender /packages]...
289
+ composer require [options] [--] [vendor /packages]...
290
290
</ pre >
291
291
292
292
</ section >
@@ -365,6 +365,7 @@ <h6>HTTP Middleware <a href="http://laravel.com/docs/middleware" title="HTTP Mid
365
365
< pre class ="prettyprint lang-php ">
366
366
// Assigning Middleware To Routes
367
367
Route::get('admin/profile', ['middleware' => 'auth', function(){}]);
368
+ Route::get('admin/profile', function(){})-> middleware('auth');
368
369
</ pre >
369
370
370
371
< h6 > Named Routes</ h6 >
@@ -374,6 +375,7 @@ <h6>Named Routes</h6>
374
375
Route::get('user/profile', [
375
376
'as' => 'profile', 'uses' => 'UserController@showProfile'
376
377
]);
378
+ Route::get('user/profile', 'UserController@showProfile')-> name('profile');
377
379
$url = route('profile');
378
380
$redirect = redirect()-> route('profile');
379
381
</ pre >
@@ -438,7 +440,7 @@ <h6>Query Logging <a href="http://laravel.com/docs/database#query-logging" title
438
440
</ section >
439
441
440
442
< section class ="cmd-description grid-item ">
441
- < h4 > < a name ="urls " href ="#urls "> URL</ a > < a href ="http://laravel.com/api/5.0 /Illuminate/Routing/UrlGenerator.html " title ="UrlGenerator @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > < a href ="http://laravel.com/docs/helpers#urls " title ="URL helper @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
443
+ < h4 > < a name ="urls " href ="#urls "> URL</ a > < a href ="http://laravel.com/api/5.1 /Illuminate/Routing/UrlGenerator.html " title ="UrlGenerator @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > < a href ="http://laravel.com/docs/helpers#urls " title ="URL helper @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
442
444
< pre class ="prettyprint lang-php ">
443
445
URL::full();
444
446
URL::current();
@@ -476,7 +478,7 @@ <h4><a name="events" href="#events">Event</a> <a href="http://laravel.com/docs/e
476
478
</ section >
477
479
478
480
< section class ="cmd-description grid-item ">
479
- < h4 > < a name ="db " href ="#db "> DB</ a > < a href ="http://laravel.com/docs/5.0 /database " title ="Basic Database Usage @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
481
+ < h4 > < a name ="db " href ="#db "> DB</ a > < a href ="http://laravel.com/docs/5.1 /database " title ="Basic Database Usage @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
480
482
481
483
< h6 > Basic Database Usage</ h6 >
482
484
< pre class ="prettyprint lang-php ">
@@ -499,7 +501,7 @@ <h6>Basic Database Usage</h6>
499
501
DB::commit();
500
502
</ pre >
501
503
502
- < h6 > Query Builder < a href ="http://laravel.com/docs/5.0 /queries " title ="Query Builder @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
504
+ < h6 > Query Builder < a href ="http://laravel.com/docs/5.1 /queries " title ="Query Builder @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
503
505
< pre class ="prettyprint lang-php ">
504
506
// Retrieving All Rows From A Table
505
507
DB::table('name')-> get();
@@ -565,7 +567,7 @@ <h6>Query Builder <a href="http://laravel.com/docs/5.0/queries" title="Query Bui
565
567
$users = DB::table('users')-> skip(10)-> take(5)-> get();
566
568
</ pre >
567
569
568
- < h6 > Joins < a href ="http://laravel.com/docs/5.0 /queries#joins " title ="Joins @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
570
+ < h6 > Joins < a href ="http://laravel.com/docs/5.1 /queries#joins " title ="Joins @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
569
571
< pre class ="prettyprint lang-php ">
570
572
// Basic Join Statement
571
573
DB::table('users')
@@ -588,7 +590,7 @@ <h6>Joins <a href="http://laravel.com/docs/5.0/queries#joins" title="Joins @ Lar
588
590
-> get();
589
591
</ pre >
590
592
591
- < h6 > Aggregates < a href ="http://laravel.com/docs/5.0 /queries#aggregates " title ="Aggregates @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
593
+ < h6 > Aggregates < a href ="http://laravel.com/docs/5.1 /queries#aggregates " title ="Aggregates @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
592
594
< pre class ="prettyprint lang-php ">
593
595
$users = DB::table('users')-> count();
594
596
$price = DB::table('orders')-> max('price');
@@ -602,7 +604,7 @@ <h6>Aggregates <a href="http://laravel.com/docs/5.0/queries#aggregates" title="A
602
604
DB::table('name')-> cacheTags(array('my-first-key','my-second-key'))-> remember(5)-> get();
603
605
</ pre >
604
606
605
- < h6 > Raw Expressions < a href ="http://laravel.com/docs/5.0 /queries#raw-expressions " title ="Raw Expressions @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
607
+ < h6 > Raw Expressions < a href ="http://laravel.com/docs/5.1 /queries#raw-expressions " title ="Raw Expressions @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
606
608
< pre class ="prettyprint lang-php ">
607
609
$users = DB::table('users')
608
610
-> select(DB::raw('count(*) as user_count, status'))
@@ -659,7 +661,7 @@ <h6>Inserts / Updates / Deletes / Unions / Pessimistic Locking</h6>
659
661
660
662
< section class ="cmd-description grid-item ">
661
663
< h4 > < a name ="eloquent " href ="#eloquent "> Model</ a > < a href ="http://laravel.com/docs/eloquent " title ="Eloquent @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
662
- < h6 > Basic Usage < a href ="http://laravel.com/docs/5.0 /eloquent#basic-usage " title ="Basic Usage @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
664
+ < h6 > Basic Usage < a href ="http://laravel.com/docs/5.1 /eloquent#basic-usage " title ="Basic Usage @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
663
665
< pre class ="prettyprint lang-php ">
664
666
// Defining An Eloquent Model
665
667
class User extends Model {}
@@ -715,7 +717,7 @@ <h6>More</h6>
715
717
Model::all()-> orderBy('column','desc');
716
718
</ pre >
717
719
718
- < h6 > Soft Delete < a href ="http://laravel.com/docs/5.0 /eloquent#soft-deleting " title ="Soft Deleting @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
720
+ < h6 > Soft Delete < a href ="http://laravel.com/docs/5.1 /eloquent#soft-deleting " title ="Soft Deleting @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h6 >
719
721
< pre class ="prettyprint lang-php ">
720
722
Model::withTrashed()-> where('cars', 2)-> get();
721
723
// Include the soft deleted models in the results
@@ -877,7 +879,7 @@ <h4><a name="localization" href="#localization">Lang</a> <a href="http://laravel
877
879
</ section >
878
880
879
881
< section class ="cmd-description grid-item ">
880
- < h4 > < a name ="files " href ="#files "> File</ a > < a href ="http://laravel.com/api/5.0 /Illuminate/Filesystem/Filesystem.html " title ="Filesystem @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
882
+ < h4 > < a name ="files " href ="#files "> File</ a > < a href ="http://laravel.com/api/5.1 /Illuminate/Filesystem/Filesystem.html " title ="Filesystem @ Laravel Docs "> < i class ="icon-file-text "> </ i > </ a > </ h4 >
881
883
< pre class ="prettyprint lang-php ">
882
884
File::exists('path');
883
885
File::get('path');
0 commit comments