Code Monkey home page Code Monkey logo

Comments (7)

andrew13 avatar andrew13 commented on September 24, 2024

Not sure, I'll take a look at a fresh install and let you know.

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 24, 2024

For a temporary fix view the file vendor/zizaco/confide/src/Zizaco/Confide/ConfideUser.php
and the function "sendEmail" at the bottom.

/**
     * Send email using the lang sentence as subject and the viewname
     * 
     * @param mixed $subject_translation
     * @param mixed $view_name
     * @return voi.
     */
    private function sendEmail( $subject_translation, $view_name, $params = array() )
    {
        if ( static::$_app['config']->getEnvironment() == 'testing' )
            return;

        $this->fixViewHint();

//        static::$_app['mailer']->send($view_name, $params, function($m) use ($subject_translation)
//        {
//            $m->to( $this->email )
//            ->subject( static::$_app['translator']->get($subject_translation) );
//        });
    }

That should get you past that first step. It's still an issue, and I will resolve it, but if you need to get up and running now that should do it.

from laravel-4-bootstrap-starter-site.

imkane avatar imkane commented on September 24, 2024

Cool, that workaround did the trick, thanks!

from laravel-4-bootstrap-starter-site.

Zizaco avatar Zizaco commented on September 24, 2024

@andrew13,

This happens because the db:seed are creating an User with blank fields. The SwiftMailer acuses error because "" (emptystring) is not a valid e-mail.

zizaco@ubuntu:~/Projetos/php_projects/tmp/laravel_bootstrap$ php artisan db:seed

  [Swift_RfcComplianceException]                                                 
  Address in mailbox given [$this->email] does not comply with RFC 2822, 3.6.2.  

db:seed [--class[="..."]] [--database[="..."]]

zizaco@ubuntu:~/Projetos/php_projects/tmp/laravel_bootstrap$ tinker
Starting php with extra includes: ['bootstrap/autoload.php', 'bootstrap/start.php']
type 'h' or 'help' to see instructions & features
php> echo User::all();
[{"id":13,"username":"admin","email":"[email protected]","confirmation_code":"","confirmed":0,"created_at":"0000-00-00 00:00:00","updated_at":"0000-00-00 00:00:00"},
{"id":14,"username":"user","email":"[email protected]","confirmation_code":"","confirmed":0,"created_at":"0000-00-00 00:00:00","updated_at":"0000-00-00 00:00:00"},
{"id":15,"username":"","email":"","confirmation_code":"b3de267181c3d2809ab35e0e5dd0f910","confirmed":0,"created_at":"2013-02-17 16:25:39","updated_at":"2013-02-17 16:25:39"}]

Note that the last user has an empty username and email. That's the user that are causing the error. I believe that user shoudn't be there. Even though if I validate the email in ConfideUser before actually sending the email would solve the problem, that would be redundant since the validation rules have:

'password' => 'required|between:4,11|confirmed',

You should take a look at what is creating this phantom user.

from laravel-4-bootstrap-starter-site.

Zizaco avatar Zizaco commented on September 24, 2024

This:
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/master/app/database/seeds/PostsTableSeeder.php#L29

and
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/master/app/database/seeds/CommentsTableSeeder.php#L14

Are creating that empty user.

I believe instead of doing User::create you should do DB::table('posts')->insert( //pass array here And instead of using the hardcoded id of 1, maybe you should do $id = User::first()->id; and use that id. Cause after some tries the id is no longer 1.

from laravel-4-bootstrap-starter-site.

Zizaco avatar Zizaco commented on September 24, 2024

@andrew13, i've done a pull request, take a look. #4

from laravel-4-bootstrap-starter-site.

andrew13 avatar andrew13 commented on September 24, 2024

That fixes it. Thanks Zizaco for dropping in with a fix.

from laravel-4-bootstrap-starter-site.

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.