{"action":"created","issue":{"url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/155","repository_url":"https://api.github.com/repos/InfyOmLabs/laravel-generator","labels_url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/155/comments","events_url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/155/events","html_url":"https://github.com/InfyOmLabs/laravel-generator/issues/155","id":155840653,"number":155,"title":"Tell me what you think","user":{"login":"phillipmadsen","id":7799233,"avatar_url":"https://avatars.githubusercontent.com/u/7799233?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipmadsen","html_url":"https://github.com/phillipmadsen","followers_url":"https://api.github.com/users/phillipmadsen/followers","following_url":"https://api.github.com/users/phillipmadsen/following{/other_user}","gists_url":"https://api.github.com/users/phillipmadsen/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipmadsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipmadsen/subscriptions","organizations_url":"https://api.github.com/users/phillipmadsen/orgs","repos_url":"https://api.github.com/users/phillipmadsen/repos","events_url":"https://api.github.com/users/phillipmadsen/events{/privacy}","received_events_url":"https://api.github.com/users/phillipmadsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-19T21:34:09Z","updated_at":"2016-05-21T01:27:29Z","closed_at":null,"body":"If we are using multiple prefix's on both new and old models we should probably figure out what items can be shared and what items need to be separate. So far I  have one setup with the following but would like to know what you guys think.\r\n\r\n### Shared\r\n* models\r\n* repositories\r\n* functions.php / helpers.php\r\n\r\n### Not Shared\r\n* controllers\r\n* requests\r\n* fields_file\r\n* {prefixed}public/assets\r\n* {prefixed}/layouts/*\r\n\r\nI  am starting to think It might help if we have 3 or 4 prefix options instead of 2 but i am still trying to work it out and have not been able to yet. \r\n\r\n1- RoutePrefix\r\n2- PathPrefix\r\n3- ViewsPrefix\r\nmaybe even a forth for \r\n4- PublicPrefix\r\n\r\nThis way even if all of the prefixes are not used they can default to the main prefix: \r\n***prefix = admin would be all 4 unless otherwise specified. ***\r\nthen you could seperate all of the part into assignable options. \r\n*example: for public you could have themes  and can switch from one to another using this convention.*\r\n\r\nOr maybe have the layouts assigned in the controller so the route pulls the right views when directed.\r\n***example blog with layouts selected in controller:***\r\n```php\r\n\r\npublic function index(Request $request)\r\n  {\r\n    $tag = $request->get('tag');\r\n    $data = $this->dispatch(new BlogIndexData($tag));\r\n    $layout = $tag ? Tag::layout($tag) : 'blog.layouts.index';\r\n\r\n    return view($layout, $data);\r\n  }\r\n\r\n  public function showPost($slug, Request $request)\r\n  {\r\n    $post = Post::with('tags')->whereSlug($slug)->firstOrFail();\r\n    $tag = $request->get('tag');\r\n    if ($tag) {\r\n        $tag = Tag::whereTag($tag)->firstOrFail();\r\n    }\r\n\r\n    return view($post->layout, compact('post', 'tag'));\r\n  }\r\n\r\n\r\n```\r\n\r\n# As of right know that Is all I have been working on but by all means lets collaborate."},"comment":{"url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/comments/220751092","html_url":"https://github.com/InfyOmLabs/laravel-generator/issues/155#issuecomment-220751092","issue_url":"https://api.github.com/repos/InfyOmLabs/laravel-generator/issues/155","id":220751092,"user":{"login":"phillipmadsen","id":7799233,"avatar_url":"https://avatars.githubusercontent.com/u/7799233?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipmadsen","html_url":"https://github.com/phillipmadsen","followers_url":"https://api.github.com/users/phillipmadsen/followers","following_url":"https://api.github.com/users/phillipmadsen/following{/other_user}","gists_url":"https://api.github.com/users/phillipmadsen/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipmadsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipmadsen/subscriptions","organizations_url":"https://api.github.com/users/phillipmadsen/orgs","repos_url":"https://api.github.com/users/phillipmadsen/repos","events_url":"https://api.github.com/users/phillipmadsen/events{/privacy}","received_events_url":"https://api.github.com/users/phillipmadsen/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T01:27:29Z","updated_at":"2016-05-21T01:27:29Z","body":"## Prefix Concept\r\nOk i did some testing today trying to find out the most effective way to use prefixes for both backwards compatibility and new generation. \r\n\r\n***My proposal is this:***\r\n>  RoutePrefix\r\n>  PathPrefix\r\n>  ViewsPrefix\r\n>  PublicPrefix\r\n\r\nNot only will these be very precise when building or converting exiting apps but it will also make it really hard for a hacker to get the hang of so will keep the app more secure. Not only that but it will also make it hard for someone with no laravel experience to mess up.\r\n\r\nNow let me explain why.\r\n\r\nlets say we have a basic blog and the normal routes would be something along the lines of\r\n```\r\nBLOG\r\n    |- App\r\n        |- Console\r\n        |- Events\r\n        |- Exceptions\r\n        |- Helpers\r\n        |- Http\r\n            |- Controllers\r\n                |- ADMIN:controllers  \r\n                OR\r\n                |- BACKEND:controllers  \r\n            |- Middleware\r\n            |- Requests\r\n                |- ADMIN:Requests\r\n                OR\r\n                |- BACKEND:Requests\r\n        |- Jobs\r\n        |- Listeners\r\n        |- Models\r\n            |- ADMIN:models\r\n            OR\r\n            |- BACKEND:\r\n        |- Policy\r\n        |- Providers\r\n        |- Repositories\r\n        |- Services\r\n    |- config\r\n    |- database\r\n    |- public\r\n        |- ADMIN:ASSETS\r\n            |- css\r\n            |- js\r\n            |- images\r\n        OR\r\n        |- BACKEND:\r\n            |- css\r\n            |- js\r\n            |- images\r\n        |- css\r\n        |- js\r\n        |- images\r\n    |- resources\r\n        |- lang\r\n        |- assets\r\n        |- views\r\n            |- admin = ADMIN AREA\r\n                    |- users\r\n                    |- posts\r\n                    OR\r\n            |- backend = ADMIN AREA\r\n                    |- users\r\n                    |- posts\r\n            |- users\r\n            |- posts\r\n    |- Storage\r\n```\r\nIf you are familiar with laravel or any other framework they all have the same tree structures. This makes it very easy to learn and take advantage of.  As you can see the main pathways, routes and everything else are essentially the same as the other. This makes it very easy to get into each one without much trouble just my knowing one you pretty much know them all. \r\n\r\nThis also means if you already have an app and its admin section let say is backend for files but not for the routes then you would have to redo all of the files in that directory, and not be able to use the generator.\r\n\r\n>  But\r\n\r\nWith laravel you can have the same thing but with names of everything not alike and very hard to determine without having access to the filesystem itself. Here is what I  propose.\r\n\r\nAwesome Blog\r\n>  { RoutePrefix = ADMIN }\r\n>  { PathPrefix = BACKEND }\r\n>  { ViewsPrefix = SECURE }\r\n>  { PublicPrefix = ADMINLTE }\r\n\r\nThis would work out something like this:\r\n\r\n>  Routes.php\r\n```\r\nRoute::get('admin/users' [ 'as' => 'secure.users', 'uses' => 'Backend\\UsersController@getIndex']);\r\n```\r\n>  App\\Http\\Controllers\\Backend\\UsersController.php\r\n\r\n```\r\npublic function getIndex()\r\n{\r\n    $users = User::orderBy('created_at', 'DESC')->paginate(10);\r\n\r\n    return view('secure.users.index', compact('users'))->with('active', 'user');\r\n}\r\n```\r\n>  public/adminlte/layouts/app.blade.php\r\n\r\n```\r\n{!! asset('/adminlte/assets/css') !!}\r\n{!! asset('/adminlte/assets/is') !!}\r\n{!! asset('/adminlte/assets/images') !!}\r\n```\r\n>  SHARED ASSETS\r\n>   App\\MODELS\\User.php\r\n>   App\\REPOSITORIES\\UserRepository.php\r\n\r\nAs you can see it would be very hard to get to say the controller from the path in the assets or the route provided in the actions from the forms. \r\n\r\nBut like I  said the best part is this leaves the backwards compatability to work in a already build app with the directories that are within it. \r\n\r\n>  And\r\n\r\nSay you didnt want to do all this and you are building new then all of them default back to the first prefix supplied or none at all. \r\n\r\n>  QUICK EXAMPLE OF POSSIBILITIES\r\n>  \r\n```\r\nAWESOME APP\r\n    |- App\r\n        |- Console\r\n        |- Events\r\n        |- Exceptions\r\n        |- Helpers\r\n        |- Http\r\n            |- Controllers\r\n                |- UsersController\r\n                    |- {PathPrefix = BACKEND }: index, show, edit, create, update, delete // using {PublicPrefix = ADMINLTE }:ASSETS\r\n                    |- {PathPrefix = FRONTEND }: index, show // using {PublicPrefix = liveSite }:ASSETS\r\n            |- Middleware\r\n            |- Requests\r\n                |- {PathPrefix = BACKEND }: index, show, edit, create, update, delete  // using {PublicPrefix = ADMINLTE }:ASSETS\r\n                |- {PathPrefix = FRONTEND }: index, show // using {PublicPrefix = liveSite }:ASSETS\r\n        |- Jobs\r\n        |- Listeners\r\n        |- Models\r\n            |- uSER:Shared\r\n        |- Policy\r\n        |- Providers\r\n        |- Repositories\r\n            |- uSER:Shared\r\n        |- Services\r\n    |- config\r\n    |- database\r\n    |- public\r\n        |- {PublicPrefix = ADMINLTE }:ASSETS\r\n            |- css\r\n            |- js\r\n            |- images\r\n        |- {PublicPrefix = LIVESITE }:ASSETS\r\n            |- css\r\n            |- js\r\n            |- images\r\n    |- resources\r\n        |- lang\r\n        |- assets\r\n        |- views\r\n            |- {ViewsPrefix = SECURE } = ADMIN AREA\r\n                    |- users  // using {PublicPrefix = ADMINLTE }:ASSETS\r\n                    |- posts  // using {PublicPrefix = ADMINLTE }:ASSETS\r\n            |- users // using {PublicPrefix = liveSite }:ASSETS\r\n            |- posts// using {PublicPrefix = liveSite }:ASSETS\r\n    |- Storage\r\n```\r\n\r\n\r\n "}}
{"actor":{"display_login":"phillipmadsen"}}