Aq1

Aq1

Member Since 1 Month Ago

Experience Points 350
Experience Level 1

4,650 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 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

31 May
2 weeks ago

Aq1 started a new conversation Argument 1 Passed To Illuminate\Auth\SessionGuard::login() Must Be An Instance Of Illuminate\Contracts\Auth\Authenticatable, Instance Of Illuminate\Http\RedirectResponse Given

I am using email verification at the time of registration using PHP mailer. I have implemented the complete functionality on ONE SERVER and it is working perfectly fine there.

Now I have changed my server and I have uploaded the same project on my Other server but it is showing this error

Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of Illuminate\Http\RedirectResponse given, called in /home/exuijbqo/public_html/app2/ico/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php 

this is my User.php

<?php

namespace App;

use App\PasswordSecurity;
use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable 
{
    use Notifiable;

    const ADMIN_TYPE = 'admin';
    const DEFAULT_TYPE = 'user';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password', 'fname', 'lname', 'username',
        'gender','country', 'province', 'city', 'status',  'zip_code', 'address','is_admin', 'code', 'profile','referred_by', 'verification_code', 'verify_internal_transfer',
    ];

 
    protected $hidden = [
        'password', 'remember_token',
    ];

 
    public function isAdmin()
    {
        if($this->role->name =='admin')
       {
           return true;
       }else
       {
               return false;
        }
    }

    public function role()
    {
        return $this->belongsTo('App\Role');
    }
    
}

RegisterController.php

use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Registered;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Hash;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

class RegisterController extends Controller
{
use RegistersUsers;
 protected $redirectTo = '/email-verify';
 protected function create(array $data)
    {//Generate Random pin For email verification
        $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $pin = mt_rand(1000, 9999)
            . $characters[rand(0, strlen($characters) - 1)]
            . mt_rand(1000, 9999)
            . $characters[rand(0, strlen($characters) - 1)];
        $password_pin = str_shuffle($pin);

        if($data) {

            include('../vendor/autoload.php');
            $mail = new PHPMailer(true);
            $user_name = $data['username'];
            $user_email = $data['email'];


            try {
           
                $mail->isSendmail();
                $mail->Host = 'smtp.gmail.com';
                $mail->SMTPAuth = true;
                $mail->Username = '[email protected]';
                $mail->Password = '******';
                $mail->SMTPSecure = 'tls';
                $mail->Port = 587;

                //Recipients
                $mail->setFrom('[email protected]', 'XYZ');
                $mail->addAddress($user_email, $user_name);

                $mail->isHTML(true);
                $mail->Subject = 'Verify Email Address';
                $mail->Body    = 'Hello! Please enter the code to verify your email address. Your verification pin is : '. $password_pin .' If you did not create an account, no further action is required.';


                $mail->send();
            } catch (Exception $e) {
                return back()->with('error','Message could not be sent.');
            }
        }

          return  User::create([
            'username' => $data['username'],
            'is_admin' => User::DEFAULT_TYPE,
            'email' => $data['email'],
            'referred_by' => $referred_by,
            'password' => Hash::make($data['password']),
            'verification_code' => $password_pin,
            'verify_internal_transfer' => 0,
        ]);
}
}

Any idea why same code is working find on one server and is showing error on the other server?

29 May
2 weeks ago

Aq1 left a reply on 2fa Middleware Is Not Working

This is me route

Route::post('/internal-transfer', '[email protected]_internal_transfer')->name('internal-transfer')->middleware('2fa');

and I also tried this

  public function __construct()
    {
        $this->middleware('2fa');
    }

I included this middleware in kernel.php file

  protected $routeMiddleware = [
 '2fa' => \App\Http\Middleware\Google2FAMiddleware::class,
 ];
28 May
2 weeks ago

Aq1 left a reply on Failed To Authenticate On SMTP Server With Username

Ok I have resolved this error. I changed my .env

MAIL_DRIVER=sendmail MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=****** MAIL_ENCRYPTION=tls

when I was working on my localhost then MAIL_DRIVER=smtp was working fine and when I uploaded my project on cpanel then I was getting this error.

I simply changed my MAIL_DRIVER from smtp to sendmail and it is working perfectly fine.

Aq1 left a reply on Failed To Authenticate On SMTP Server With Username

@SERGIU17 - Yes I have disabled two step authentication and I have enable access for less secure apps but it's still not working

Aq1 started a new conversation 2fa Middleware Is Not Working

Hi, I have used "Google2FA for Laravel" package and it is working fine. When the user tries to log-in the are requested to enter one-time password. If the user enters correct one-time password, they are redirected to dashboard. Now I want to use this authentication for my internal bank transfer functionality, I have put the routes of internal transfer in 2fa Middleware. But it's not working and the users is not asked to enter one-time password.

What am I doing wrong?

Aq1 started a new conversation Failed To Authenticate On SMTP Server With Username

Hi. I'm working on email verification and I am using Phpmailer package. When a users registers then an email with a verification code is sent to their email. Users are required to enter the code if the code matches, users are redirected to Dashboard.

Now, whenever I register then I am receiving an email with code and the data is also stored on DB but instead of redirecting me to the verify-email.blade , I am receiving this error

"Failed to authenticate on SMTP server with username "[email protected]" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Incorrect authentication data ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Incorrect authentication data "."

20 May
4 weeks ago

Aq1 started a new conversation Method Illuminate\Http\Request::upload Does Not Exist.

I'm trying to upload file and I'm using dropzonejs.

this is my html

CNIC Attachements
PNG, JPG, BMP, PDF. File size < 15Mb

In controller, error occurred here..

$upload_success = Input::upload('file', $directory, $filename);

How can I resolve this error? (Method Illuminate\Http\Request::upload does not exist.)

14 May
1 month ago

Aq1 left a reply on "You Need To Install The Imagick Extension To Use This Back End" - Cpanel Error

Thank you @devfrey @diegoaurino . I did contact my hosting provider and now my problem has been resolved.

13 May
1 month ago

Aq1 started a new conversation "You Need To Install The Imagick Extension To Use This Back End" - Cpanel Error

Hi. I'm a beginner, learning laravel. I'm working on a two factor google authentication feature. I've used these two packages pragmarx/google2fa-laravel and bacon/bacon-qr-code. I did the implementation on localhost and I received an error in the barcode page "You need to install the imagick extension to use this back end" , so I installed the imagick in my application and included .dll files in C:\xampp\apache\bin . By doing so, my errors were resolved and the authentication was working fine on localhost. Now I've implemented the project on live. But again I'm getting this error "You need to install the imagick extension to use this back end"..

I need help to install imagick on my server. Any ideas?

Aq1 left a reply on ImageMagic Magic Module Not Available Even When Phpinfo Shows That Imagick Is Installed

Hi. I'm working on a two step google authentication feature. I've used these two packages pragmarx/google2fa-laravel and bacon/bacon-qr-code. I did the implementation on localhost and I received an error in the barcode page "You need to install the imagick extension to use this back end" , so I installed the imagick in my application and included .dll files in C:\xampp\apache\bin . By doing so, my errors were resolved and the authentication was working fine on localhost. Now I've implemented the project on live. But again I'm getting this error "You need to install the imagick extension to use this back end"..

I need help to install imagick on my server. Any ideas?