Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Add New Menu NavBar

Joel Marcos Cardoso De Araujo   ( User )

Commented 3 years ago

Good night, I managed to add a new menu, but when I click on it I get error 403, access denied. What could be missing?

this is the code to add the new menu:
$menu->add(['route' => ['salespeoples.index', [] ], 'title' => trans('general.salesprices'), 'icon' => 'fas fa-pen', 'order' => 5]);

this is the route created for the new menu:
Route::resource('salespeoples', 'Sales\Salespeoples');

this is the controller created for the new menu:

namespace App\Http\Controllers\Sales;

use App\Abstracts\Http\Controller;
use App\Exports\Sales\Customers as Export;
use App\Http\Requests\Common\Contact as Request;
use App\Http\Requests\Common\Import as ImportRequest;
use App\Imports\Sales\Customers as Import;
use App\Jobs\Common\CreateContact;
use App\Jobs\Common\DeleteContact;
use App\Jobs\Common\UpdateContact;
use App\Models\Banking\Transaction;
use App\Models\Common\Contact;
use App\Models\Document\Document;
use App\Models\Setting\Currency;
use Date;
use Illuminate\Http\Request as BaseRequest;

class Salespeoples extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$customers = Contact::with('invoices.transactions')->customer()->collect();
// dd($customers);

return $this->response('sales.salespeoples.index', compact('customers'));
}
}

Leonardo Gomes   ( User )

Commented 3 years ago

Hello José,

Did you create some permissions for your app?
I had the same issue some time back, and after i create the permissions, i could access it.

Joel Marcos Cardoso De Araujo   ( User )

Commented 3 years ago

Hello Leonardo,

could you tell me how you could create these permissions?

It would help a lot.

Leonardo Gomes   ( User )

Commented 3 years ago

Hello,

take a look on the modules Paypal > Database > seed > Permission.php

Please login or register to leave a response.

Showing 1 to 4 of 4 discussions