Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 2 years ago.
0

bump. I'd really like to use Laravel as base for my projects, but i need a way to create multiple entry points with some shared resources across all of them. Any hints appreciated :)

Last updated 2 years ago.
0

I am currently doing almost the same thing, I'd like to hear some advices too

Last updated 2 years ago.
0

I am doing the same.. This is how i organized my folders:

// load my shared array data

\app\config\custom.php

// coontrollers

\app\controllers\frontend

\app\controllers\backend

//models

\app\models\frontend

\app\models\backend

// frontend views

\app\views\frontend_layout

\app\views\frontend\user

\app\views\frontend\login

\app\views\frontend\register

// backend views

\app\views\backend_layout

\app\views\backend\user

\app\views\backend\login

\app\views\backend\register

\app\views\backend\post

//any customer view

\app\views\www

// Backend subdomain
Route::group(array('domain' => 'backend.mydomain.com'), function()
{
       // Public
	Route::get('/login', function()
	{
		return View::make('backend.login.index');
	});
	
	// AUTHENTICATION REQUIRED
	Route::group(array('before' => 'auth'), function()
	{
            ///add your routers here....
	});//end auth
});//end domain


// front end subdomain
Route::group(array('domain' => 'frontend.mydomain.com'), function()
{
       // Public
	Route::get('/login', function()
	{
		return View::make('backend.login.index');
	});
	
	// AUTHENTICATION REQUIRED
	Route::group(array('before' => 'auth'), function()
	{
            ///add your routers here....
	});//end auth
});//end domain


// any customer
Route::group(array('domain' => 'customername.mydomain.com'), function()
{
    ///add your routers here....
});//end domain

Last updated 2 years ago.
0

It would be helpful if you explain what the folders are for even the obvious ones just to know we are on the same page.

Last updated 2 years ago.
0

Here's a simple route pattern for a separate admin area:

Route::group(array('prefix' => 'admin'), function()
{
    //put admin routes here
});

//put front-end routes here
Last updated 2 years ago.
0

You could add a namespace to the autoloader and keep your files seperated like this folder structure.

App\ACME\Admin App\ACME\Admin\composers App\ACME\Admin\controllers App\ACME\Admin\controllers\BaseControlle App\ACME\Admin\views App\ACME\Admin\services App\ACME\Admin\AdminServiceProvider.php

App\ACME\Data App\ACME\Data\Models App\ACME\Data\Observers App\ACME\Data\Repositories App\ACME\Data\DataServiceProvider.php

App\ACME\Site App\ACME\Site\composers App\ACME\Site\controllers App\ACME\Site\controllers\BaseController App\ACME\Site\views App\ACME\Site\services App\ACME\Site\SiteServiceProvider.php

Last updated 2 years ago.
0

I think its best to go with @juukie14 by using namespaces.

For e.g. you can do

App
-- Models
    -- Backend
    -- Frontend

And inside the folder go with

<?php namespace Backend;
Last updated 2 years ago.
0

juukie14 said:

You could add a namespace to the autoloader and keep your files seperated like this folder structure.

App\ACME\Admin App\ACME\Admin\composers App\ACME\Admin\controllers App\ACME\Admin\controllers\BaseControlle App\ACME\Admin\views App\ACME\Admin\services App\ACME\Admin\AdminServiceProvider.php

App\ACME\Data App\ACME\Data\Models App\ACME\Data\Observers App\ACME\Data\Repositories App\ACME\Data\DataServiceProvider.php

App\ACME\Site App\ACME\Site\composers App\ACME\Site\controllers App\ACME\Site\controllers\BaseController App\ACME\Site\views App\ACME\Site\services App\ACME\Site\SiteServiceProvider.php

@juunkie14 If you separate the admin like that how do I load a view file since blade files aren't namespaces? Would I just prefix it with the namespace like this View:make('ACME\Admin:index');

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

marktyler marktyler Joined 10 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.