> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laravelshopper.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Controllers

> Learn how to create and configure custom controllers for the Shopper admin panel.

<Warning>
  This is documentation for Shopper v1, which is no longer maintained. Please refer to the [v2 docs](/v2) for the latest information.
</Warning>

Controllers group related Laravel request handling logic into single classes stored in the `app/Http/Controllers/` directory. In this section we will create our own controllers to add functionality to our admin panel.

To configure your controllers, you need to look at the `controllers` key in the `shopper/system.php` configuration file.

```php theme={null}
'controllers' => [

	'namespace' => 'App\\Http\\Controllers\\Shopper',

],
```

This implies that all controllers that will be loaded into the shopper control panel must be in the `app/Http/Controllers/Shopper` folder.

But you can change this namespace, you can change it for example to load them into a **CPanel** folder. For this your configuration should look like this

```php theme={null}
'controllers' => [

	'namespace' => 'App\\Http\\Controllers\\CPanel',

],
```

## Create Controller

You can create a controller using the following laravel command, which will generate a class in the `App\Http\Controllers\Shopper` namespace.

```bash theme={null}
php artisan make:controller Shopper\\PostController
```

You can now add all your actions and set up the management of your articles

```php theme={null}
namespace App\Http\Controllers\Shopper;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class PostController extends Controller
{
	//
}
```
