From e14633927092ec448a3ed647121748cc51676483 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 16 Jan 2015 11:00:18 +0100 Subject: [PATCH 1/4] Optimized Resource Controller Laravel in php_laravel snippet --- UltiSnips/php_laravel.snippets | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 9f817a8..b7c88fd 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -7,33 +7,30 @@ snippet l_rsc "Laravel resource controller" b * \date `!v strftime('%d-%m-%y')` */ -class $1 { - public function index() { - ${3} - } - - public function create() { +class $1 extends ${3: BaseController} { + function __construct() { ${4} } + public function index() { + } + + public function create() { + } + public function store($id) { - ${5} } public function show($id) { - ${6} } public function edit($id) { - ${7} } public function update($id) { - ${8} } public function destroy($id) { - ${9} } } endsnippet From 66079c34e877e981f1fe7c4cdc5c511c2116300b Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Tue, 20 Jan 2015 17:12:38 +0100 Subject: [PATCH 2/4] Bug fix laravel snippet --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index b7c88fd..26eda92 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -114,7 +114,7 @@ namespace $1; class $2 extends \Eloquent { protected $table = '${4:`!p snip.rv = t[2].lower()`}'; - public $timestamps = '${5:false}'; + public $timestamps = ${5:false}; protected $hidden = array(${6}); From 9e904e17df7186d5efc7efc8c44ceaf21e46f363 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Tue, 20 Jan 2015 17:21:02 +0100 Subject: [PATCH 3/4] Another bug fix --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 26eda92..d39a77b 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -193,7 +193,7 @@ snippet l_r "Laravel Repository" b /*! * \namespace ${1:Repositories\\${2}} * \class ${3:`!v expand('%:t:r')`} - * \implements ${4:BaseRepositoryInterface} + * \implements ${4:$3RepositoryInterface} * * \author ${5:`!v g:snips_author`} * \date `!v strftime('%d-%m-%y')` From af05269858bae78b562156810943666db24555fc Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 30 Jan 2015 18:08:12 +0100 Subject: [PATCH 4/4] Bug fix laravel snippet --- UltiSnips/php_laravel.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index d39a77b..30f3f36 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -201,8 +201,8 @@ snippet l_r "Laravel Repository" b namespace $1; -class $3 extends \\$1 implements $4 { - ${6} +class $3 extends \\${6} implements $4 { + ${7} } endsnippet