Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
rollback db after generating a model factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Qoraiche committed Mar 27, 2019
1 parent a4174e9 commit 97a764a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mailEclipse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static public function getMailables()
{
return self::mailablesList();
}


static public function getMailable($key, $name)
{
Expand All @@ -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();

Expand All @@ -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() );
Expand Down Expand Up @@ -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 ){
Expand Down Expand Up @@ -709,6 +707,8 @@ static public function handleMailableViewDataArgs($mailable)
return $foo;

}

DB::rollBack();
}

}
Expand Down

0 comments on commit 97a764a

Please sign in to comment.