Git Product home page Git Product logo

Comments (17)

aimeos avatar aimeos commented on May 21, 2024 2

Authentication in Laravel is a bit more complicated than that. Therefore, we've linked to the Laravel 5.1 and 5.2 documentation.

The extadm interface is the expert mode where you can do anything supported by Aimeos. But it's too complicated for casual users, so we've created the jqadm interface as alternative.

from aimeos-laravel.

dronowar avatar dronowar commented on May 21, 2024 1

I had the same problem, I think it will be useful to specify the documentation php artisan make: auth for laravel 5.2 users
and why did you two admin interface?
/admin
/extadm

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

You forgot to create your page template: https://github.com/aimeos/aimeos-laravel#setup

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

Thank you it works
do i have to adjust anything for admin to make it works out?

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

when it try to login to Admin i got following error:

NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 823

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

Setting up authentication is a bit tricky in Laravel because it depends on the version and 5.1/5.2 are totally different. Please set up authentication according to the Laravel docs first and test if it works. Afterwards, follow the docs: https://github.com/aimeos/aimeos-laravel#admin

If you use Laravel 5.1, don't forget to set up the /login route!

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

Thank you alot for fast replying
I used laravel 5.2
and i followed the steps in url you gave
and i replaced
the whole function boot
by the following function

public function boot(GateContract $gate)
{
// ...

$gate->define('admin', function($user) {
    return app( '\Aimeos\Shop\Base\Support' )->checkGroup( $user->id, 'admin' );
});

}
so do i miss anything?

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

You must not replace the whole method, only add the $gate->define() call because at least the parent::... before is important

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

my file looks like

namespace App\Providers;

use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];

/**
 * Register any application authentication / authorization services.
 *
 * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
 * @return void
 */
public function boot(GateContract $gate)
{
    // ...
    $this->registerPolicies($gate);    
    $gate->define('admin', function($user) {
        return app( '\Aimeos\Shop\Base\Support' )->checkGroup( $user->id, 'admin' );
    });        


        //

}

}

is that what you mean?

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

Yes, exactly.

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

i think frontend shop is working

and admin login page is working too
http://127.0.0.1:8000/admin

but when i use email and password the url redirect
to http://127.0.0.1:8000/login

and give me the following error:

`Sorry, the page you are looking for could not be found.

1/1
NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 823
at Router->findRoute(object(Request)) in Router.php line 691
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54
at require_once('D:\xampp\htdocs\laravel\aimeos-shop\public\index.php') in server.php line 21`

Thank you in advance

from aimeos-laravel.

aimeoscom avatar aimeoscom commented on May 21, 2024

If you are using Laravel 5.2, php ./artisan make:auth should have added a /login route:
https://laravel.com/docs/5.2/authentication

You can check with php ./artisan route:list

from aimeos-laravel.

c1t1zen avatar c1t1zen commented on May 21, 2024

Thank you for replying
now i got no errors

from aimeos-laravel.

quoport avatar quoport commented on May 21, 2024

I followed all of the instructions using 5.2, I am getting error:

Class App\Providers\GateContract does not exist

Did I miss something?

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

Did you create the authentication stuff with php artisan make: auth?

from aimeos-laravel.

worla avatar worla commented on May 21, 2024

@quoport , were you able to find a solution to this problem?

Class 'App\Providers\Gate' not found

from aimeos-laravel.

aimeos avatar aimeos commented on May 21, 2024

@worla What Laravel and Aimeos versions are you using?

from aimeos-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.