Coder Social home page Coder Social logo

Comments (13)

bschlinker avatar bschlinker commented on August 23, 2024

I took a closer look into the stack dump produced by L4.

I have a C++ background so the PHP keywords are different, but I can tell your goal is to override the save functionality provided by the base class Eloquent. However, this isn't occurring -- save() directly calls the Eloquent save method and never hits anything from Ardent or from confide

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Well that should be removed before it tries to save. in src/Zizaco/Confide/ConfideUser.php

/**
     * Ardent method overloading:
     * Before save the user. Generate a confirmation
     * code if is a new user.
     *
     * @param bool $forced Indicates whether the user is being saved forcefully
     * @return bool
     */
    public function beforeSave( $forced = false )
    {
        if ( empty($this->id) )
        {
            $this->confirmation_code = $this->generateUuid($this->table, 'confirmation_code');
        }

        /*
         * Remove password_confirmation field before save to
         * database.
         */
        if ( isset($this->password_confirmation) )
        {
            unset( $this->password_confirmation );
        }

        return true;
    }

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Interesting that it isn't hitting ardent or confide... I'll have to troubleshoot it to confirm this.

from confide.

bschlinker avatar bschlinker commented on August 23, 2024

Yes, I located the above code -- note my most recent response, the stack dump shows that the call to save() is never hitting Ardent or Confide. See here: http://i.imgur.com/f58j5hD.png

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Can I have look at your User Model?

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Maybe in a gist?

from confide.

bschlinker avatar bschlinker commented on August 23, 2024

Standard model from the install: http://paste.laravel.com/q1i (I can do gist also, but this should work).

I don't understand why it extends Eloquent -- this seems wrong, but I don't know much about PHP. I thought it would extend ConfideUser or Ardent.

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Ah that'll do it. Your thought is correct. Try this instead:

<?php

use Zizaco\Confide\ConfideUser;

class User extends ConfideUser {

/*Super awesome code here*/

}

from confide.

bschlinker avatar bschlinker commented on August 23, 2024

Awesome, so my C++ knowledge works in PHP, I was pretty sure that was wrong but forgot to add in the use Zizaco\Confide\ConfideUser; when I tried making the change myself.

How has it worked up until now with it like this?

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

I dunno? Magic? I kid, but seriously not sure.

and glad your C++ is working in PHP as well. You've picked the right framework to get familiar with PHP.

from confide.

bschlinker avatar bschlinker commented on August 23, 2024

Considering solving this by writing a new ModelCommand, similar to ControllerCommand, etc.

Comments?

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

If you're looking for more command line generators, I'd take a look at https://github.com/JeffreyWay/Laravel-4-Generators

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

"Closing since the issue was resolved, but doesn't mean we have to the conversation."

from confide.

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.