@@ -105,20 +105,6 @@ public function create(MountFormRequest $request)
105105 $ model = (new Mount ())->fill ($ request ->validated ());
106106 $ model ->forceFill (['uuid ' => Uuid::uuid4 ()->toString ()]);
107107
108- foreach (Mount::$ invalidSourcePaths as $ path ) {
109- if (Str::startsWith ($ model ->source , $ path )) {
110- $ this ->alert ->danger ('" ' . $ path . '" cannot be used as a source path. ' )->flash ();
111- return redirect ()->route ('admin.mounts ' );
112- }
113- }
114-
115- foreach (Mount::$ invalidTargetPaths as $ path ) {
116- if (Str::startsWith ($ model ->target , $ path )) {
117- $ this ->alert ->danger ('" ' . $ path . '" cannot be used as a target path. ' )->flash ();
118- return redirect ()->route ('admin.mounts ' );
119- }
120- }
121-
122108 $ model ->saveOrFail ();
123109 $ mount = $ model ->fresh ();
124110
@@ -142,23 +128,7 @@ public function update(MountFormRequest $request, Mount $mount)
142128 return $ this ->delete ($ mount );
143129 }
144130
145- $ mount ->forceFill ($ request ->validated ());
146-
147- foreach (Mount::$ invalidSourcePaths as $ path ) {
148- if (Str::startsWith ($ mount ->source , $ path )) {
149- $ this ->alert ->danger ('" ' . $ path . '" cannot be used as a source path. ' )->flash ();
150- return redirect ()->route ('admin.mounts.view ' , $ mount ->id );
151- }
152- }
153-
154- foreach (Mount::$ invalidTargetPaths as $ path ) {
155- if (Str::startsWith ($ mount ->target , $ path )) {
156- $ this ->alert ->danger ('" ' . $ path . '" cannot be used as a target path. ' )->flash ();
157- return redirect ()->route ('admin.mounts.view ' , $ mount ->id );
158- }
159- }
160-
161- $ mount ->save ();
131+ $ mount ->forceFill ($ request ->validated ())->save ();
162132
163133 $ this ->alert ->success ('Mount was updated successfully. ' )->flash ();
164134
0 commit comments