GithubHelp home page GithubHelp logo

Admin.php about ntrust HOT 11 CLOSED

klaravel avatar klaravel commented on July 28, 2024
Admin.php

from ntrust.

Comments (11)

klaravel avatar klaravel commented on July 28, 2024

What is connection between User and Admin? Both should be diffrent user type.

If you like to add Admin for ntrust then use follwing code.
You have to create three model manully.

Admin user model

<?php

use Klaravel\Ntrust\Traits\NtrustUserTrait;

class Admin extends Authenticatable
{
    use NtrustUserTrait; // add this trait to your user model

    /*
     * Role profile to get value from ntrust config file.
     */
    protected static $roleProfile = 'admin';

    ...
}
<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Klaravel\Ntrust\Traits\NtrustRoleTrait;

class AdminRole extends Model
{
    use NtrustRoleTrait;

    /*
     * Role profile to get value from ntrust config file.
     */
    protected static $roleProfile = 'admin';
}
<?php 

namespace App;

use Illuminate\Database\Eloquent\Model;
use Klaravel\Ntrust\Traits\NtrustPermissionTrait;

class AdminPermission extends Model
{
    use NtrustPermissionTrait;

    /*
     * Role profile to get value from ntrust config file.
     */
    protected static $roleProfile = 'admin';
}

Migration file should looks like below one. There should be create 4 tables for admin.
You have to create Admin table manually. Depend on your requirement.

2016_10_05_010232_admin_ntrust_setup_tables.txt

Let me know if you have more questions.

from ntrust.

andrietri avatar andrietri commented on July 28, 2024

i get same error
Class 'App\User' not found vendor/klaravel/ntrust/src/Ntrust/Commands/MigrationCommand.php on line 95

how to solve that?

from ntrust.

klaravel avatar klaravel commented on July 28, 2024

@andrietri Can you please give more detail about your code or can you please show me your code?

from ntrust.

andrietri avatar andrietri commented on July 28, 2024

@klaravel my code just default first time install laravel 5.3. i follow installiation klaravel/ntrust and run
"php artisan ntrust:migration" but error message like that

from ntrust.

andrietri avatar andrietri commented on July 28, 2024

@klaravel
PHP Fatal error: Class 'App\User' not found in /opt/lampp/htdocs/atlasmu/vendor/kla ravel/ntrust/src/Ntrust/Commands/MigrationCommand.php on line 95

[Symfony\Component\Debug\Exception\FatalErrorException] Class 'App\User' not found

from ntrust.

klaravel avatar klaravel commented on July 28, 2024

@andrietri Do you have App\User class?

What is your default profile in config\ntrust.php?

try to replace 'model' => 'App\User', to 'model' => App\User::class, in your ntrust.php config file

from ntrust.

andrietri avatar andrietri commented on July 28, 2024

yes i have, my default profile in config\ntust.php
'defaults' => [ 'profile' => 'user', ],

i try to replace that but still not work
[Symfony\Component\Debug\Exception\FatalErrorException] Class 'App\User::class' not found

from ntrust.

manearaluca avatar manearaluca commented on July 28, 2024

Hello,
Did anybody solved this problem?
I have the same issue.
Thanks,
Raluca

from ntrust.

ajmerainfo avatar ajmerainfo commented on July 28, 2024

@manearaluca

What problem do you have?

from ntrust.

andrietri avatar andrietri commented on July 28, 2024

from ntrust.

manearaluca avatar manearaluca commented on July 28, 2024

Hello, I had to create the model Users inside App folder. So, no problem!
Thank you!

from ntrust.

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.