To add a new snippet;
Tools -> Developer -> New Snippet...
| <snippet> | |
| <content><![CDATA[ | |
| public function ${1:relationship}() | |
| { | |
| return \$this->belongsToMany(${2:${1/^(.+)$/(?1\u$1:)/g}}::class${3:, '${4:table}'}); | |
| } | |
| ]]></content> | |
| <tabTrigger>belm</tabTrigger> | |
| <scope>source.php</scope> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| public function ${1:relationship}() | |
| { | |
| return \$this->belongsTo(${1/^(.+)$/(?1\u$1:)/g}::class); | |
| } | |
| ]]></content> | |
| <tabTrigger>belo</tabTrigger> | |
| <scope>source.php</scope> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| <?php | |
| namespace Tests\Feature; | |
| use Tests\TestCase; | |
| use Illuminate\Foundation\Testing\WithFaker; | |
| use Illuminate\Foundation\Testing\RefreshDatabase; | |
| class ${TM_FILENAME/(\w+)\.php/\1/} extends TestCase | |
| { | |
| use RefreshDatabase; | |
| ${0} | |
| } | |
| ]]></content> | |
| <tabTrigger>uf</tabTrigger> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| public function ${1:relationship}() | |
| { | |
| return \$this->hasMany(${1/^(.+)$/(?1\u$1:)/g}::class); | |
| } | |
| ]]></content> | |
| <tabTrigger>hasm</tabTrigger> | |
| <scope>source.php</scope> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| public function ${1:relationship}() | |
| { | |
| return \$this->hasOne(${1/^(.+)$/(?1\u$1:)/g}::class); | |
| } | |
| ]]></content> | |
| <tabTrigger>haso</tabTrigger> | |
| <scope>source.php</scope> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| /** @test */ | |
| function ${1:the_one_where}() | |
| { | |
| ${0} | |
| } | |
| ]]></content> | |
| <tabTrigger>test</tabTrigger> | |
| <scope>source.php</scope> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| <?php | |
| namespace Tests\Unit; | |
| use Tests\TestCase; | |
| use Illuminate\Foundation\Testing\WithFaker; | |
| use Illuminate\Foundation\Testing\RefreshDatabase; | |
| class ${TM_FILENAME/(\w+)\.php/\1/} extends TestCase | |
| { | |
| use RefreshDatabase; | |
| ${0} | |
| } | |
| ]]></content> | |
| <tabTrigger>ut</tabTrigger> | |
| </snippet> |
| <snippet> | |
| <content><![CDATA[ | |
| <template> | |
| ${0} | |
| </template> | |
| <script> | |
| export default { | |
| props: [${1}], | |
| data() { | |
| return { | |
| ${2} | |
| } | |
| }, | |
| methods: { | |
| ${3} | |
| }, | |
| } | |
| </script> | |
| ]]></content> | |
| <tabTrigger>vue</tabTrigger> | |
| </snippet> |