ekpono

ekpono

Web Developer at Sophtcode

Lagos

Member Since 2 Months Ago

Experience Points 12,360
Experience
Level
Lessons Completed 109
Lessons
Completed
Best Reply Awards 1
Best Answer
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.

06 Nov
1 month ago

ekpono left a reply on Laravel Global Helper Functions Not Working

Let's see where you are making the call and what you are trying to achieve

ekpono left a reply on Laravel Job Is In The Jobs Table But Not Dispatching

The job in the console is only processing not processed and dispatched. what am i doing wrong?

ekpono left a reply on Laravel Job Is In The Jobs Table But Not Dispatching

yes. I have done php artisan queue:work and php artisan queue:listen It is still not dispatching the job

05 Nov
1 month ago

ekpono started a new conversation Laravel Job Is In The Jobs Table But Not Dispatching

The job is in my jobs table but it is not sending the mail

    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {

        Mail::to($user->email)->send(new VerifyMail($user));
    }
20 Oct
1 month ago

ekpono started a new conversation How To Exit Out Of Saving A Record If A Condition Is Not True

I want to save a record in my table but i have set a condition that must be met before it is saved. I don't know if this is the best approach.

 public function transaction($data, $loanTransaction)
    {
        $loanTransaction = find($data['loan_id']);
        $loanTransaction = new LoanTransaction;
        $loanTransaction->decrement($loanTransaction['duration']);

        if(! $loanTransaction['amount'] === $loanTransaction->amount){
            die          
        }

        $loanTransaction->paid_date = $loanTransaction['paid_date'];
        $loanTransaction->payment_method = $loanTransaction['payment_method'];
        $loanTransaction->bank_name = $loanTransaction['bank_account_id'];
        $loanTransaction->save();

        return true;
    }

I want to make sure the amount entered is the save with the one in the database before saving. Am i to die or return false please which approach is the best way to go.

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

Yes.. it is a hasMany relationship. Thank you so much.

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

Like so?

    public function getBalanceAttribute()
    {
        return $this->loanHistory->sum('amount');
    }

Loan loanHistory is the relationship Since the query is running through relationship it should always be updated. so no need inject now() in the Accessor? I guess

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

@Dalma Thank you so much for your contributions. Can i have a resources i can go through but so far i have an idea on how to get through to it. A guide would help too

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

ok. Since the history is where all the financial information is. All payments/transactions should be posted to LoanHistory model then?

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

create an entry in this table when the loan record is created. I don't quite understand the entry part? :(

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

Please how will the logic in my controller look like? Or am i to save and update only histories table?

ekpono left a reply on Call To Undefined Method

It is your port 8080 or any other port you are using that is missing.

Your url is this http://localhost/password/reset/6a863bf328d6450a8c9bfa167b2091ae1bf80c468a97b3a04f636b8c918faae1

instead of this http://localhost:8080/password/reset/6a863bf328d6450a8c9bfa167b2091ae1bf80c468a97b3a04f636b8c918faae1

ekpono left a reply on I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

Here's my table structure

        Schema::create('loans', function (Blueprint $table) {
            $table->string('id');
            $table->string('company_id')->index();
            $table->string('name');
            $table->datetime('start_date');
            $table->datetime('end_date');
            $table->string('duration');
            $table->double('amount')->default(4, 7);
            $table->string('purpose');
            $table->enum('isActive');
            $table->timestamps();
        });

        Schema::create('loan_histories', function (Blueprint $table) {
            $table->string('id');
            $table->string('loan_id')->index();
            $table->integer('duration');
            $table->double('amount_paid')->default(4, 7);
            $table->datetime('paid_date');
            $table->double('remaining_balance')->default(4, 7);
            $table->string('payment_method');
            $table->string('bank_name');
            $table->timestamps();
        });
    }

ekpono started a new conversation I Want To Build A Loan Feature In Laravel Project. How Do I Keep Track On Updated Input

Let's say a user collected $2,000 loan. At the end of the month, the user pays $200 in first month and another $200 the second month. Now, i have history table that will keep track of each transaction and record it. The issue am facing is how do i work out the logic in keeping the history updated when a deduction is made on the loan table. Please any suggestion will go a long way. Thanks

18 Oct
1 month ago

ekpono left a reply on Installation Problem

5.7 is the latest version. @Snapey funny question

ekpono left a reply on Eloquent Query Picking Wrong Database For The User Model

If the model is pointing to the wrong table you can use this in your table model protected $table = 'name_of_the_table'

12 Oct
2 months ago

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

I talked to namecheap support, they gave me working port. @Cronix @D9705996 Thanks so much guyz. With selfless people like you guyz, i can build anything. It makes me want to give more to the community

11 Oct
2 months ago

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

yes .. it supposed to be sent via phone. But am not getting the code.

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Though the mailgun account is not verified Am still getting this when verifying

An error occurred while attempting to send your verification code, please try again. Contact Support if the issue persists.

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Have switch to mailgun

λ nmap -Pn -pT:25 smtp.mailgun.org
Starting Nmap 7.70 ( https://nmap.org ) at 2018-10-11 23:42 W. Central Africa Standard Time
Stats: 0:00:06 elapsed; 0 hosts completed (0 up), 0 undergoing Host Discovery
Parallel DNS resolution of 1 host. Timing: About 0.00% done
Nmap scan report for smtp.mailgun.org (35.161.201.187)
Host is up (0.45s latency).
Other addresses for smtp.mailgun.org (not scanned): 52.26.154.214
rDNS record for 35.161.201.187: ec2-35-161-201-187.us-west-2.compute.amazonaws.com

PORT   STATE SERVICE
25/tcp open  smtp

Nmap done: 1 IP address (1 host up) scanned in 8.14 seconds

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

i have ssh into my server and perform the same command but am getting -bash error

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

i'm getting this

 nmap -Pn -pT:2525 smtp.mailtrap.io
Starting Nmap 7.70 ( https://nmap.org ) at 2018-10-11 23:32 W. Central Africa Standard Time
Nmap scan report for smtp.mailtrap.io (34.194.188.188)
Host is up (0.19s latency).
Other addresses for smtp.mailtrap.io (not scanned): 34.199.205.108 52.203.151.210
rDNS record for 34.194.188.188: ec2-34-194-188-188.compute-1.amazonaws.com

PORT     STATE SERVICE
2525/tcp open  ms-v-worlds

Nmap done: 1 IP address (1 host up) scanned in 7.63 seconds

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

:( :( I'm getting this

 nmap -Pn -pT:2525 stmp.mailtrap.io
Starting Nmap 7.70 ( https://nmap.org ) at 2018-10-11 23:30 W. Central Africa Standard Time
Failed to resolve "stmp.mailtrap.io".
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 1.16 seconds

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@D9705996 thanks so much for your reply. I have hosted the site on namecheap. I want it that when a user signsup on the platform I will get a notification to follow up the user base on the information given to me on the platform. I am using mailtrap (though i have tried mailgun, gmail and still getting the same error) so i can get the email. I also intend to automatically forward the mail to [email protected]

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@D9705996 what should I do now? I am using shared hosting by the way. How can i resolve this

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@Cronix mailgun is not sending verification code to my phone. That's where am stuck

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Still getting this. Connection could not be established with host smtp.mailtrap.io [Connection refused #111]

MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=25 MAIL_USERNAME=55cd6ac6e**e7bc MAIL_PASSWORD=ee968240**24b3 MAIL_ENCRYPTION=tls

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@D9705996 not still working

MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=25 MAIL_USERNAME=55cd6ac6e5e7bc MAIL_PASSWORD=ee968240f524b3 MAIL_ENCRYPTION=tls

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@Cronix thanks for the clearification. I want to forward the mail from mailtrap to [email protected] At least i get notifications from there. @Cronix what the best option can you prefer. I need this up and running soonest. Thanks

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

@D705996

Starting Nmap 7.70 ( https://nmap.org ) at 2018-10-11 22:09 W. Central Africa Standard Time
Nmap scan report for www.koboaccountant.com (199.188.200.47)
Host is up.
rDNS record for 199.188.200.47: server239-2.web-hosting.com

PORT     STATE    SERVICE
2525/tcp filtered ms-v-worlds

Nmap done: 1 IP address (1 host up) scanned in 16.55 seconds

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Still unable to send through mailtrap. Have installed nmap but in my command line, it doesn't recognize it.

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

I am getting command not found in all the 3 commands

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

On ssh it is am having $ nmap -Pn -Pt:2525 koboaccountant.com -bash: nmap: command not found

ekpono left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

.env MAIL_ENCRYPTION=NULL

I want to receive the main in [email protected] What other options do I have?

ekpono started a new conversation Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Connection could not be established with host smtp.mailtrap.io [Connection refused #111] on live server. Here is my credentials

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=my-username
MAIL_PASSWORD=mypassword

Please help out it is urgent. Have cleared config. Have also optimize:clear

ekpono left a reply on Unable To Connect To Host 127.0.0.1 Because Access Was Denied.

Your username and password may be wrong. Cross check your db details

ekpono left a reply on TokenMismatchException

put this in the head tag <meta name="csrf-token" content="{{ csrf_token() }}">

03 Oct
2 months ago

ekpono left a reply on I Want To Get Last Logged In Date From My User. The Database Isn't Updating

Finally used event listener

App\Listener\UpdateLastLoginAt

<?php

namespace App\Listeners;

use Illuminate\Auth\Events\Login;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Carbon\Carbon;
class UpdateLastLoginAt
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  Login  $event
     * @return void
     */
    public function handle(Login $event)
    {
        $event->user->last_login_at = Carbon::now();
        $event->user->save();
    }

App\Providers\UpdateLastLoginAt

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'App\Events\Event' => [
            'App\Listeners\EventListener',
        ],
        'Illuminate\Auth\Events\Login' => [
            'App\Listeners\UpdateLastLoginAt',
    ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();

        //
    }
}

That worked for me

ekpono left a reply on I Want To Get Last Logged In Date From My User. The Database Isn't Updating

        'name', 'email', 'password','gender','last_login_at', 'last_login_ip',
    ];

yes.

last_login_at is used consistently.

ekpono left a reply on I Want To Get Last Logged In Date From My User. The Database Isn't Updating

Users Table

        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->datetime('last_login_at')->nullable();
            $table->string('last_login_ip')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

Auth::routes();

Route::get('/home', 'Hom[email protected]')->name('home');

AuthenticatesUser traits
public function authenticated(Request $request, $user) 
    { 
        $user = Auth::User();
        if ($user != null && $user != "")
            {
                $loginedIn = User::where('id', Auth::id())->update(['last_login_at' => Carbon::now()]);
            }
    }

ekpono left a reply on I Want To Get Last Logged In Date From My User. The Database Isn't Updating

yes.. i meant to say AuthenticatesUsers trait

ekpono left a reply on I Want To Get Last Logged In Date From My User. The Database Isn't Updating

Yes. am using default laravel auth command