GithubHelp home page GithubHelp logo

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'slug' in 'where clause' (SQL: select count(*) as aggregate from `users` where `slug` = test12345 and `users`.`deleted_at` is null) about cms HOT 2 OPEN

nakamotojp avatar nakamotojp commented on May 28, 2024
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'slug' in 'where clause' (SQL: select count(*) as aggregate from `users` where `slug` = test12345 and `users`.`deleted_at` is null)

from cms.

Comments (2)

nakamotojp avatar nakamotojp commented on May 28, 2024

class Role{}

  1. /lavalite/app/Facades/Role.php
  2. /lavalite/app/Forms/Role.php
  3. /lavalite/app/Litepie/Role.php
  4. /lavalite/app/Models/Role.php
  5. /lavalite/vendor/lavalite/framework/src/Litepie/Roles/Forms/Role.php
  6. /lavalite/vendor/lavalite/framework/src/Litepie/Roles/Models/Role.php

function findBySlug{}

  1. /lavalite/vendor/lavalite/framework/src/Litepie/Database/Traits/Sluggable.php
    public static function findBySlug($slug, $columns = ['*'])
    {
        return self::whereSlug($slug)->first($columns);
    }
  1. /lavalite/vendor/lavalite/framework/src/Litepie/Repository/Eloquent/BaseRepository.php
    public function findBySlug($value = null, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->whereSlug($value)->first($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }

function attachRole

  1. /lavalite/vendor/lavalite/framework/src/Litepie/Roles/Models/Role.php
    public function attachRoles($user)
    {
        $guard = $this->getGuardRoute();
        $roles = config('auth.register.roles.' . $guard, null);

        if ($roles == null) {
            return;
        }

        foreach ($roles as $role) {
            $roleId = Role::findBySlug($role)->id;
            $user->attachRole($roleId);
        }

        return true;
    }
  1. /lavalite/vendor/lavalite/framework/src/Litepie/Roles/Interfaces/HasRoleAndPermission.php
    public function attachRole($role);

/lavalite/vendor/lavalite/framework/src/Litepie/Roles/Models/Role.php

class Role extends Model implements RoleHasRelationsContract
{
    use Filer;
    use Hashids;
    use Sluggable;
    use PresentableTrait;
    use RoleHasRelations;

if I add use Litepie\Roles\Models\Role; in /lavalite/app/Http/Controllers/Auth/RegisterController.php

there are Call to undefined method App\Models\User::notify() , Because I am not logged in.

image

from cms.

nakamotojp avatar nakamotojp commented on May 28, 2024

Breeze Wouldn't you use it?

from cms.

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.