Skip to content

Instantly share code, notes, and snippets.

@marcosrjjunior
Last active November 8, 2016 13:20
Show Gist options
  • Save marcosrjjunior/73c822d4ba0792e40617019deab6c6d6 to your computer and use it in GitHub Desktop.
Save marcosrjjunior/73c822d4ba0792e40617019deab6c6d6 to your computer and use it in GitHub Desktop.
Menu->Tools->Developer->New Snipper..
<!-- dd($object) -->
<snippet>
<tabTrigger>dd</tabTrigger>
<content><![CDATA[
dd(${1:this});
]]></content>
</snippet>
<!-- dd($object) for views -->
<snippet>
<tabTrigger>ddv</tabTrigger>
<content><![CDATA[
{!! dd(${1:this}); !!}
]]></content>
</snippet>
<!-- print_r -->
<snippet>
<tabTrigger>ddr</tabTrigger>
<content><![CDATA[
echo '<pre>';
print_r(${1:this});
echo '</pre>';
exit;
]]></content>
</snippet>
<!-- (belo) belongsTo relation -->
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsTo(${1/^(.+)$/(?1\u$1:)/g}:class);
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belo</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<!-- (belt) belongsToMany relation -->
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}:class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment