-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
401b6f8
commit 64edbbc
Showing
8 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Laravel 5 Snippets for Sublime Text | ||
https://github.com/Lykegenes/laravel-5-snippets | ||
|
||
|
||
Version 1.2.11 | ||
******************************************************************************** | ||
|
||
#### NEW SNIPPETS | ||
|
||
New Route snippets have been added for the get/post/put/delete actions. | ||
|
||
New snippets have been added to create model relationships. | ||
They are now available under the `Relation::` trigger keyword. | ||
|
||
Happy coding! | ||
|
||
Improvements or suggestions? Contribute on GitHub! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
public function ${1:user}() | ||
{ | ||
return \$this->belongsTo('${2:App\User}'${3:, '${4:foreign_key}'}${5:, '${6:other_key}'}); | ||
} | ||
]]></content> | ||
<tabTrigger>Relation::belongsTo</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>A one-to-one inverse relationship.</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
public function ${1:roles}() | ||
{ | ||
return \$this->belongsToMany('${2:App\Role}'${3:, '${4:role_user_table}'}${5:, '${6:user_id}'}${7:, '${8:role_id}'}); | ||
} | ||
]]></content> | ||
<tabTrigger>Relation::belongsToMany</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>A many-to-many relationship.</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
public function ${1:comments}() | ||
{ | ||
return \$this->hasMany('${2:App\Comment}'${3:, '${4:foreign_key}'}${5:, '${6:local_key}'}); | ||
} | ||
]]></content> | ||
<tabTrigger>Relation::hasMany</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>A one-to-many relationship.</description> | ||
</snippet> |
11 changes: 11 additions & 0 deletions
11
snippets/Relations/Relation-hasManyThrough.sublime-snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
public function ${1:comments}() | ||
{ | ||
return \$this->hasManyThrough('${2:App\Comment}', ${3:App\Post}); | ||
} | ||
]]></content> | ||
<tabTrigger>Relation::hasManyThrough</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>A Has Many Through relationship.</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
public function ${1:user}() | ||
{ | ||
return \$this->hasOne('${2:App\User}'${3:, '${4:foreign_key}'}${5:, '${6:local_key}'}); | ||
} | ||
]]></content> | ||
<tabTrigger>Relation::hasOne</tabTrigger> | ||
<scope>source.php</scope> | ||
<description>A one-to-one relationship.</description> | ||
</snippet> |