luis02lopez

luis02lopez

Member Since 2 Years Ago

Experience Points 1,290
Experience Level 1

3,710 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

01 Aug
1 year ago
22 Jul
1 year ago

luis02lopez left a reply on Manually Set Intended() URL For Login

Session::put('url.intended', URL::full()); directly in the blade works for me.

20 Jul
2 years ago

luis02lopez left a reply on Does An Email Reset Implementation Exist (just Like The Password Reset)?

Cool @QuentinPain if it works, please set the answer as the correct answer. ;)

luis02lopez left a reply on Manually Set Intended() URL For Login

@Snapey Do you think your answer in the related post, could work with L4.2?

18 Jul
2 years ago

luis02lopez left a reply on Does An Email Reset Implementation Exist (just Like The Password Reset)?

Hi, @QuentinPain why don't just create a view with a form directing to a function in your users controller and in the controller, just check if the email the person will use is totally new in you DB and check the password. A workaround as how could this be is:

(Remeber to have LaravelCOllective package to follow my instructions with Forms https://laravelcollective.com/docs/master/html#installation)

Create a view to get the new email and check for the password:

@if(Session::has('message'))
    <div class="alert alert-warning alert-kinbu alert-dismissible" role="alert">
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">×</span>
    </button>
    <div class="alert-body">{{ Session::get('message') }}</div>
    </div>
    @endif 
{!! Form::open(['action' => '[email protected]', 'method' => 'POST']) !!}

{!! Form::label('email', ' New E-mail Address') !!}
{!! Form::text('email', '[email protected]') !!}

{!! Form::label('password', 'Password') !!}
{!! Form::password('password', ['class' => 'password-style']) !!}

{!! Form::close() !!}

Create the routes to show the form and the take the POST information of the form:

Route::get('user/emailreset', '[email protected]')->name('reset');
//and for take the POST form information...
    Route::post('user/emailresetsccss', '[email protected]')->name('emailresetsccss');

In the UserController:

    public function showEmailreset()
{
    return View::make('ereset');
}

//create a view of ereset.blade.php

     public function emailresetsccss()
{
    $input['email'] = Input::get('email');
$password = Input::get('password');

//checking existing emails

$rules = array('email' => 'unique:users,email');

$validator = Validator::make($input, $rules);

if (!$validator->fails()) {
        return Redirect::back()->with('message', 'Mail already taken.');
}
if (Hash::check($password, $this->user->password)) {
        $this->user->person()->update(Input::get('person'));
        $this->user->save();
        $this->user->touch();
        return Response::json(['success' => true, 'message' => 'Email updated.']);
    }

}

Tha's it. Hop works, if something happends, reply me.

16 Jul
2 years ago

luis02lopez left a reply on Curl Errorr

Hi, do you have installed cURL in your server?

luis02lopez left a reply on Urgent Need Help Returning User With Id

Whay don't use Auth:: ?

id = Auth::user()->id;

This get the id of the user logged in.

Or with what you have:

$notifications->user->id;

luis02lopez left a reply on Create Feature Branch In Git

Hey, you could maintain a Master branch with all the features, and have individual branchs for each costumer you have.

luis02lopez left a reply on How To Change Url Naming Convention For Site?

Route::get('site/terms', ['uses' => '[email protected]', 'as' => 'terms']);

You can change the 'site/terms' with the name you want.

luis02lopez left a reply on DataBase Notification

Maybe you could specify this on the route file like:

Route::group(['before' => ['auth', 'is_admin'], 'prefix' => 'admin'], function (){

//Routes just allowed for admin...

}

luis02lopez left a reply on Sof Delete

Yes, I suggest to you use a status in DB in roder to know if it's deleted, active, etc.

luis02lopez left a reply on Does An Email Reset Implementation Exist (just Like The Password Reset)?

@QuentinPain Simply read and try step by step the instructions in documetation: https://laravel.com/docs/5.4/passwords

Just be sure about the traits that should include in your user model and go on with the php artisan commands. If you have some other question or problem in the process, reach me with other entry.

15 Jul
2 years ago

luis02lopez left a reply on Contact Form Error View [contact.contact] Not Found

Hi friend, the "." dot is meaning of the folder like: arriving/welcome.blade.php you use: arriving.welcome

So, if your contact.blade.php is in emails/contact.blade.php you should use emails.contact you should change this part of the tutotial.

PS: Are you facing problems with a undefined variables?

luis02lopez left a reply on Does An Email Reset Implementation Exist (just Like The Password Reset)?

Sure, which version of laravel are you using?

06 Jul
2 years ago

luis02lopez left a reply on Ownerships Of Logs Folder In Production Enviroment

@Snapey Yes it created a new laravel.log file with www-data ownership:

-rw-r--r-- 1 www-data www-data 8318 Jul  6 16:33 laravel.log

This was created from laravel after I erase the logs files. Now I don't have permissions problems.

luis02lopez started a new conversation Ownerships Of Logs Folder In Production Enviroment

Hello guys,

I'm deploying to production in my VPS an app of laravel 4.2.

I'm facing a obstacle of permissions in /app/storage/logs it can't be opened:

Error in exception handler: The stream or file "/home/kinbu/public_html/kinbu-st1/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /home/kinbu/public_html/kinbu-st1/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

The file have the following permissions:

-rw-r--r-- 1 root root 1153012 Jul  6 04:04 laravel.log

I have an option of changing this to:

-rw-r--r-- 1 www-data www-data 1153012 Jul  6 04:04 laravel.log

Note: The root folder of my app is in and public_html on a digitalocean VPS.

Do you recommend me this approach, adding www-data the ownerhips, the members of this groups are:

www-data:x:33:

It's like "everybody".

What's your opinion?

04 Jul
2 years ago

luis02lopez left a reply on Using Imgur API For User Profile Picture In App

Yes @bashy but as it say at docs, we have limits with this. Each application can allow approximately 1,250 uploads per day or approximately 12,500 requests per day. And * If the daily limit is hit five times in a month, then the app will be blocked for the rest of the month* So I think we should prevent the users from uploading or changing it's images too much times in a day.

Thanks for your answer

luis02lopez started a new conversation Using Imgur API For User Profile Picture In App

Hey guys,

Do you know how to use the Imgur API for let the users upload the profile pictures it will use in our apps?

I would like to use this to avoid run out from space disk with profile pictures.

What do you think about this, could suggest some information to accomplish this?

I use Laravel 4.2

28 Jun
2 years ago

luis02lopez left a reply on Auth Master(universal) Password

I need a masterpassword for verifying issues in the profile of my users. I'm running something like a e-commerce and would like to have access to verify the thing which user made that provokes the error...

06 Jun
2 years ago

luis02lopez started a new conversation Php Migrate In Production Env

I have in DigitalOcean a droplet of 32Gb ram with 12 CPU (resize for occasion)

I run php artisan command (laravel 4.2-php7.0) which never ran. What could be happening? Ram monitoring

And the error message after more than 10 minutes: enter image description here

22 May
2 years ago
20 May
2 years ago

luis02lopez started a new conversation Sending Mail Using Laravel 4.2 And Mailgun

i'm little bit new to this.

I had read the documentation of Laravel 4 and some of the Mailgun, I had tested some mail and worked but just in route like this:

      Route::get('send_test_email', function(){
            Mail::send('emails.registro', array('key' => 'value'), function($message)
             {
                 $message->subject('Bienvenido a la gran experiencia');
                 $message->from(env('CONTACT_MAIL'), env('CONTACT_NAME'));
                     $message->to('[email protected]');
            });
        });

I went to myapp/send_test_email in the browser and get an email.

But now I want to send an email at registration, I created the route:

            Route::get('mail', ['uses' => '[email protected]', 'as' => 'send']);

The controller:

         <?php

            class MailController extends \BaseController {

                public function index()
                {
                    return View::make('signup');
                }

                public function send() {

                    Mail::send('emails.registro', $data, function($message) use
                    {
           
                    $message->subject('Bienvenido a la gran experiencia');

           
                    $message->from(env('CONTACT_MAIL'), env('CONTACT_NAME'));

           
                    $message->to($user->email, $user->firstname);

                    });
                }

And added a form to the signup form like this:

                {{ Form::open(['route' => 'send', 'method' => 'get']) }}

                <div class="form-group">
                 {{ Form::label('username', 'Usuario', ['class' => 'sr-only']) }}
                    {{ Form::text('username', null, ['placeholder' => 'Usuario', 'required', 'minlength' => 6, 'class' => 'form-control', ]) }}
                    @foreach($errors->get('username', '<span class=error>:message</span>') as $message)
                        {{$message}}
                    @endforeach
                </div>
             <div class="form-group">
                    {{ Form::label('password', 'Contrase&ntilde;a', ['class' => 'sr-only']) }}
                 {{ Form::password('password', ['placeholder' => 'Contrase&ntilde;a', 'required', 'minlength' => 8, 'class' => 'form-control']) }}
                    @foreach($errors->get('password', '<span class=error>:message</span>') as $message)
            {{$message}}
                    @endforeach
                </div>
                <div class="form-group">
                    {{ Form::label('password_confirm', 'Confirmar Contrase&ntilde;a', ['class' => 'sr-only']) }}
                    {{ Form::password('password_confirmation', ['placeholder' => 'Confirmar Contrase&ntilde;a', 'required', 'minlength' => 8, 'class' => 'form-control']) }}
                    @foreach($errors->get('password_confirmation', '<span class=error>:message</span>') as $message)
                        {{$message}}
                    @endforeach
                </div>
                <div class="form-group">
                    {{ Form::label('email', 'Email', ['class' => 'sr-only']) }}
                    {{ Form::email('email', null, ['placeholder' => 'Email', 'required', 'class' => 'form-control']) }}
                    @foreach($errors->get('email', '<span  class=error>:message</span>') as $message)
                        {{$message}}
                    @endforeach
                </div>
                <div class="form-group">
                    {{ Form::label('firstname', 'Nombres', ['class' => 'sr-only']) }}
                    {{ Form::text('firstname', null, ['placeholder' => 'Nombres', 'required', 'class' => 'form-control']) }}
                </div>
                <div class="form-group">
                    {{ Form::label('lastname', 'Apellidos', ['class' => 'sr-only']) }}
                    {{ Form::text('lastname', null, ['placeholder' => 'Apellidos', 'required', 'class' => 'form-control']) }}
                </div>

    <div class="form-group">
        {{ Form::submit('Registrar', ['class' => 'btn btn-lg btn-block btn-kinbu'])}}
    </div>
    {{ Form::close() }}

And I got a Parse error: syntax error, unexpected 'Mail' (T_STRING) in the controller, why?

03 May
2 years ago

luis02lopez started a new conversation Laravel “link_to_route” To JQuery <a> Tag

I have this in Laravel

  {{ link_to_route('users.publications.create', 'text of link', ['users' => $user->username]) }}

What it does is create a "< a >" HTML tag to a view in the site link this:

<a href="http://kinbu.co/users/luis02lopez/publications/create >text of link</a>

I want to have the same result in JQuery but it uses the "users" in the link route as other user:

            var action_call = $({{ link_to_route('users.publications.create', 'publica uno como intercambio',
            ['users' => $user->username], ['style' => 'color:blueviolet']) }}
            });
            body.append(action_call);

Do I need to create other var with the users name?

If any idea will be a great help. Thanks

01 May
2 years ago

luis02lopez left a reply on Adjust A Width And Height To An Image (Model-Blade)

There was other model with the imagemethod, I just added the with and height:

                public function getImageAttribute()
                {
                    return HTML::image('img/publication/'.$this->published_book_id.'/'.$this->image_file_name, '-', ['class' => 'thumb', 'width' => 150, 'height' => 200]);
                }

luis02lopez left a reply on Adjust A Width And Height To An Image (Model-Blade)

@sbcman74 I tried:

Adding a path() method in the model:

                public function photos()
                {
                    return $this->hasMany('BookPublicationPhoto', 'published_book_id');
                }

                public function path()
                {
                    $photos = $this->photos();
                    return $photos->image_url;
                }

And in the blade:

                        @forelse($publication->photos()->get() as $key => $photo)
                        <div>
                        <img class="img-class" src="{{$photo->path}}">
                        </div>
                        @empty
                        EL usuario no ha agregado fotos
                        @endforelse

But nothing, checkout the src on the browser:

http://imgur.com/QCOLBCA

luis02lopez left a reply on Adjust A Width And Height To An Image (Model-Blade)

@edoc I tried to give style to the surround but it don't work, because the keep its styles.

I tried to modify with google inspections tools like this, and the tag is who has to be modified:

http://imgur.com/dr8Fh6n

luis02lopez started a new conversation Adjust A Width And Height To An Image (Model-Blade)

Hello,

I'm trying to adjust an image with a specific width and height, but it's echoed with blade and I don't know how to.

This is the code:

In blade:

                    <li style="text-align:center"><strong>Fotos:</strong>
                        @forelse($publication->photos()->get() as $key => $photo)
                        <div>
                        {{ $photo->image }}
                        </div>
                        @empty
                        EL usuario no ha agregado fotos
                        @endforelse
                    </li>

In the model the method photos():

            public function photos()
                {
                    return $this->hasMany('BookPublicationPhoto', 'published_book_id');
                }

This is the result (Photo out of page width)

http://imgur.com/5b5ui5J

Have any idea of how I could proceed?

04 Feb
2 years ago

luis02lopez started a new conversation PDOException (1045) SQLSTATE[HY000] [1045] Laravel 4.2 MySQL 5.7

Thanks for reading my question, I had been working on this error since a week reading questions in ServerFault, Stackoverflow and AskUbuntu but couldn't figure out the problem.

I have:

Lubuntu 16.04 (ubuntu distro) Nginx Laravel 4.2.17 MySQL 5.7

I have a pre-existed project which I cloned from GitHub and everything is going well but when I go to a page which has to connect to database (Like attempt a login) I got this error:

PDOException (1045) HELP

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

Graphic Description of the Error

FILES INVOLVE

I have a .env file in the project and I had named it .env.local.php this is the file:

http://pastebin.com/UkqNSWM0

I have a database.php file in /var/www/kinbuweb/app/config/local/database.php I highlight the /config/local path which I've been reading is the configuration if I have a local enviroment (and I had named my file .env.local.php) the file in the path:

http://pastebin.com/wpCnjfx5

On the other hand I have a file out of the local folder (Path: /var/www/kinbuweb/app/config) which is called database.php too, I think is the general configuration it has:

http://pastebin.com/msp1Nmzd

What I had tried

  1. Use the credentials in the local (/var/www/kinbuweb/app/config/local/database.php) database.php configuration like this:

http://pastebin.com/C4u4pNVv

  1. Aggregate the port to the database configuration in the local folder like this:

http://pastebin.com/k0m6PrRJ

And while I got the same error: PDOException (1045) HELP

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

Any ideas with I could solve this? Thanks