I need structure tips before I create my personal website using Laravel 5.3.
(www.domain.com/admin)
MY CURRENT STRUCTURE BELOW
Preferred URLs:
Controllers:
app\Http\Controllers\Admin\AdminController.php (Backend)
app\Http\Controllers\HomeController.php (Frontend)
Routes File:
Route::group(array('domain' => 'domain.com'), function() {
Route::get('/', 'HomeController@index');
});
Route::group(array('domain' => 'admin.domain.com'), function() {
Route::get('/', 'Admin\AdminController@index');
});
VHOST:
127.0.0.1 domain.com
127.0.0.1 admin.domain.com
Should I use a separate Laravel install for my subdomain backend to be safer or should I only use one Laravel install and do the routes below?
Separate the installation only if there exists a chance that you will move the admin to some other location later. If that is not the case better keep the everything under one installation, so that the dependencies will be same and you don't need to maintain the two configs, two models for every entity etc etc. Only thing you need to keep in mind is to structure the Admin & User routes separately with controllers in different folder which you have done already.
Which is the best practice and easier to maintain?
As explained above the easier way to maintain is to keep everything under one installation.
Should I use subdomain for my Backend Admin or just use sub-folder
That's up to you. But better the admin path a not-simply-guessable one. Something like domain.com/adm1n or adm1n.domain. com or something more complex.