@@ -106,6 +106,22 @@ class Generator
106106 protected $ update_permission ;
107107 protected $ delete_permission ;
108108
109+ /**
110+ * Routes
111+ * 1. Edit Route
112+ * 2. Store Route
113+ * 3. Manage Route
114+ * 4. Create Route
115+ * 5. Update Route
116+ * 6. Delete Route.
117+ */
118+ protected $ edit_route ;
119+ protected $ store_route ;
120+ protected $ index_route ;
121+ protected $ create_route ;
122+ protected $ update_route ;
123+ protected $ delete_route ;
124+
109125 /**
110126 * Repository
111127 * 1. Repository Name
@@ -206,6 +222,14 @@ public function initialize($input)
206222 $ this ->update_permission = 'update- ' .strtolower (str_singular ($ this ->model ));
207223 $ this ->delete_permission = 'delete- ' .strtolower (str_singular ($ this ->model ));
208224
225+ //Routes
226+ $ this ->index_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.index ' ;
227+ $ this ->create_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.create ' ;
228+ $ this ->store_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.store ' ;
229+ $ this ->edit_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.edit ' ;
230+ $ this ->update_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.update ' ;
231+ $ this ->delete_route = 'admin. ' .strtolower (str_plural ($ this ->model )).'.destroy ' ;
232+
209233 //Events
210234 $ this ->events = array_filter ($ input ['event ' ]);
211235
@@ -342,11 +366,15 @@ public function getFullNamespace($name, $inside_directory = null)
342366 */
343367 public function createModel ()
344368 {
345- $ this ->createDirectory ($ this ->getBasePath ($ this ->attribute_namespace ));
369+ $ this ->createDirectory ($ this ->getBasePath ($ this ->removeFileNameFromEndOfNamespace ( $ this -> attribute_namespace ) ));
346370 //Generate Attribute File
347371 $ this ->generateFile ('Attribute ' , [
348372 'AttributeNamespace ' => ucfirst ($ this ->removeFileNameFromEndOfNamespace ($ this ->attribute_namespace )),
349373 'AttributeClass ' => $ this ->attribute ,
374+ 'editPermission ' => $ this ->edit_permission ,
375+ 'editRoute ' => $ this ->edit_route ,
376+ 'deletePermission ' => $ this ->delete_permission ,
377+ 'deleteRoute ' => $ this ->delete_route
350378 ], lcfirst ($ this ->attribute_namespace ));
351379
352380 //Generate Relationship File
0 commit comments