From 97a764aea8535fd0ec294a240f0124882a9d8399 Mon Sep 17 00:00:00 2001 From: Yassine Date: Wed, 27 Mar 2019 22:53:44 +0100 Subject: [PATCH] rollback db after generating a model factory --- src/mailEclipse.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mailEclipse.php b/src/mailEclipse.php index af993ca..e70f3bc 100644 --- a/src/mailEclipse.php +++ b/src/mailEclipse.php @@ -28,7 +28,6 @@ static public function getMailables() { return self::mailablesList(); } - static public function getMailable($key, $name) { @@ -39,7 +38,6 @@ static public function getMailable($key, $name) static public function deleteTemplate($templateSlug) { - $template = DB::table(self::$templates_table) ->where('template_slug', $templateSlug)->first(); @@ -50,8 +48,6 @@ static public function deleteTemplate($templateSlug) $template_view = self::$view_namespace.'::templates.'.$templateSlug; $template_plaintext_view = $template_view.'_plain_text'; - // return $template_plaintext_view; - if ( View::exists( $template_view ) ) { unlink( View($template_view)->getPath() ); @@ -631,6 +627,8 @@ static public function handleMailableViewDataArgs($mailable) $params = $reflection->getConstructor()->getParameters(); + DB::beginTransaction(); + $eloquentFactory = app(EloquentFactory::class); $args = collect($params)->map(function( $param ){ @@ -709,6 +707,8 @@ static public function handleMailableViewDataArgs($mailable) return $foo; } + + DB::rollBack(); } }