@@ -13,6 +13,9 @@ class AltRedirectController
1313
1414 public function index ()
1515 {
16+ // Grab the old directory just in case
17+ $ oldDirectory = with (new Blueprint )->directory ();
18+
1619 //Publish form
1720 // Get an array of values
1821 $ data = new Data ('redirects ' );
@@ -27,6 +30,9 @@ public function index()
2730 // Pre-process the values.
2831 $ fields = $ fields ->preProcess ();
2932
33+ // Reset the directory to the old one
34+ with (new Blueprint )->setDirectory ($ oldDirectory );
35+
3036 return view ('alt-redirect::index ' , [
3137 'blueprint ' => $ blueprint ->toPublishArray (),
3238 'values ' => $ fields ->values (),
@@ -38,6 +44,9 @@ public function index()
3844 public function create (Request $ request )
3945 {
4046
47+ // Grab the old directory just in case
48+ $ oldDirectory = with (new Blueprint )->directory ();
49+
4150 $ data = new Data ('redirects ' );
4251
4352 // Get a blueprint.
@@ -57,6 +66,9 @@ public function create(Request $request)
5766 $ data = new Data ('redirects ' );
5867 $ values = $ data ->all ();
5968
69+ // Reset the directory to the old one
70+ with (new Blueprint )->setDirectory ($ oldDirectory );
71+
6072 return [
6173 'data ' => $ values
6274 ];
0 commit comments