Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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