InspiredPrynce

InspiredPrynce

Software Manager at Solec Netlinks Nig. Ltd

Member Since 4 Years Ago

Enugu State

Experience Points
13,595
Total
Experience

1,405 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
106
Lessons
Completed
Best Reply Awards
0
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.

Level 3
13,595 XP
Jan
21
2 days ago
Activity icon

Started a new Conversation Verify Email On Multi-Auth

Hi guys....

I have this multi-auth app that has 3 guards, the default web guard which has the verify email enabled by default; i also have 2 other guards, i want this 2 guards to implement the verify email system, how do i do that?

Am using hesto-multi-auth. By default, laravel ships Auth::route(['verified' => 'true']) but multi-auth doent implement this

Jan
16
1 week ago
Activity icon

Replied to Database Query Duplicate Entries

I have fixed the issue, the issue is the command to clear duplicate records

Jan
15
1 week ago
Activity icon

Replied to Deleting Duplicate Records

Thank you so much for this, i appreciate, i will try it out and see the results All 3 attendances fall within a day (00:00:00 - 23:59:59)... So i should go ahead and test?

Activity icon

Replied to Database Query Duplicate Entries

The problem left is how to delete the duplicate records as they are thousands of them

Activity icon

Replied to Deleting Duplicate Records

a combination of type and staff id and date signed

Activity icon

Replied to Deleting Duplicate Records

here is my table structure

Schema::create('attendances', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('staff_id')->comment('This stores the staff id');
            $table->unsignedInteger('category_id')->comment('This stores the school or category');
            $table->dateTime('date_signed')->comment('This stores the date time');
            $table->boolean('status')->comment('This stores the sign in status e.g 1 or 0');
            $table->string('type')->comment('This stores the type of sign e.g in, out, roll');
            $table->string('longitude')->comment('This stores the longitude of the sign activity');
            $table->string('latitude')->comment('This stores the longitude of the sign activity');
            $table->timestamps();
        });
Activity icon

Replied to Combining Two Dates In A Query

thanks alot

Activity icon

Replied to Database Query Duplicate Entries

Dude you ended up leaving me more confused, i need to delete the duplicate records not create migrations or daily commands...

How do i delete it?

Activity icon

Started a new Conversation Database Query Duplicate Entries

Let me explain this to you better so i wont harm myself... I have a staff attendance system that runs offline, when there is internet, it uploads the attendance data online, then during the uploading process, it somehow creates multiple entries for numerous staffs, which means a staff will end up having more than 1 entries for a particular day...

The attendance records 3 data, the sign in, the roll call and the sign out so a staff might have maximum of 3 different records per day but cannot have more than 1 sign in a day, cannot have more than 1 roll call and cannot have more than 1 sign out in a day..

So i want to delete the duplicate entries of the staff each day...

Activity icon

Replied to Deleting Duplicate Records

Let me explain this to you better so i wont harm myself... I have a staff attendance system that runs offline, when there is internet, it uploads the attendance data online, then during the uploading process, it somehow creates multiple entries for numerous staffs, which means a staff will end up having like 6 sign in entries for a particular day...

The attendance records 3 data, the sign in, the roll call and the sign out so a staff might have maximum of 3 different records per day but cannot have more than 1 sign in a day, cannot have more than 1 roll call and cannot have more than 1 sign out in a day..

So i want to delete the duplicate entries of the staff each day...

Activity icon

Replied to What Does With(relations:'') Mean ?

Was thinking about eager-loading then i wrote lazy-loading.. Thanks for the correction

Activity icon

Replied to What Does With(relations:'') Mean ?

This is retrievening the relationships in the model... If you have a model with relationships, it uses with() to return the relationships you want, more like Lazy Loading all in one query

Activity icon

Replied to Combining Two Dates In A Query

Thanks alot for your response, it worked.. Please look at this query for me and tell me whats wrong with it.. Am trying to make sure it doesnt enter the same record twice for a day

$exists = $staff->attendances()->where('date_signed', date('Y-m-d', strtotime($data[1])))->where('type', strtolower(trim($data[3])))->first();

Activity icon

Replied to Error In Php Artisan Route:cache

The problem is a route which uses a Closure instead of a controller, which looks something like this:

//                       Thats the Closure
//                             v 
Route::get('/some/route', function() {
    return 'Hello World';
});

Since Closures can not be serialized, you can not cache your routes when you have routes which use closures.

Activity icon

Started a new Conversation Combining Two Dates In A Query

Hello guys, i have an issue... I have a staff leave system... I want to know if a particular staff is on leave within a particular date... i have 2 columns that stores the dates starting_at and ending_at

So if today is 12th January, i want to see people who are currently on leave on that day or has been on leave on that day if the day is past..

Thanks

Activity icon

Started a new Conversation Deleting Duplicate Records

Hello guys, i have an issue please someone should help me... I have duplicate records in my database, i mean thousands of them.. How do i delete the duplicates and leaving just one left?

Please...

Dec
13
1 month ago
Activity icon

Replied to New Laravel Project Keeps Going To Login Page

php artisan optimize should do the trick

Activity icon

Replied to Grouping Queries

after so many trials and errors, i have resolved to use a single row for all the records!

Activity icon

Replied to No Message

add that this to your head tag, if you have a base layout file that other files extend from, inject this code to the head tag of your file

<script>
        window.Laravel = {!! json_encode([
            'csrfToken' => csrf_token(),
        ]) !!};
    </script>
            
```
Activity icon

Replied to Grouping Queries

Can you make it in an eloquent format, so i can use Attendance::

Activity icon

Replied to Grouping Queries

Thanks alot for the advice, I will work on using a row for all the data, how do i perform this grouping action now?

Activity icon

Replied to Grouping Queries

Yes, they can never have more than 3, they can have atmost 3 rows....

The staff_id stores the staff id The status stores whether early or late, its a boolean The sign_type stores on, off or row call The date signed stores datetime of the sign action

I want to fetch all the attendances, grouping each staff records to a date, so like this

Staff Name, Sign In Time, Sign Out Time, Sign In Status, Sign Out Status

Activity icon

Replied to No Message

Add this at the within your

<script>
        window.Laravel = {!! json_encode([
            'csrfToken' => csrf_token(),
        ]) !!};
    </script>
Activity icon

Started a new Conversation Grouping Queries

Hello guys...

I have an attendance app that takes the attendance of the staff of a place, the attendance table stores the sign in as a new row and the sign out as a new row as well. The table structure goes like this...

staff_id, status, sign_type, date_signed

so i want to fetch the data in a grouped format so a staff's sign in and out records for a day can be grouped as 1..

How do i do that?

Activity icon

Replied to Calculating Retirement Date

I finally got it working, the pseudocode i wrote was the solution i needed with a combination of the responses i got from here as well did the trick!

Thanks alot guys!

Activity icon

Awarded Best Reply on Calculating Retirement Date

@sinnbeck this is the logic i need

$projected_year_of_retirement_based_on_years_of_first_appt = $years_since_first_appointment + 35;
if( by the time $projected_year_of_retirement_based_on_years_of_first_appt you are more than 60 years already)
    $you_new_retirement_date will now be 60years - $your_current_age, then add the result to your $years_since_first_appointment
but if($projected_year_of_retirement_based_on_years_of_first_appt falls before you are 60 years old)
    $you_new_retirement_date will now be $projected_year_of_retirement_based_on_years_of_first_appt 
Dec
09
1 month ago
Activity icon

Replied to Calculating Retirement Date

@willvincent & @snapey the responses am getting here was not helping the issues so am just developing other aspects of the application.

Dec
06
1 month ago
Activity icon

Replied to Calculating Retirement Date

i love your example, i would be happy if it returned the date of retirement

Dec
05
1 month ago
Activity icon

Replied to Calculating Retirement Date

your code didnt work, pretty simple huh?

Dec
03
1 month ago
Activity icon

Replied to Calculating Retirement Date

my brain is not processing information properly at the moment, i need someone to do that

Activity icon

Replied to Calculating Retirement Date

yeah, exactly, but if Bob joins when he was 20 years old, he will retire at 55, which is 35 years of service

Activity icon

Replied to Calculating Retirement Date

@sinnbeck this is the logic i need

$projected_year_of_retirement_based_on_years_of_first_appt = $years_since_first_appointment + 35;
if( by the time $projected_year_of_retirement_based_on_years_of_first_appt you are more than 60 years already)
    $you_new_retirement_date will now be 60years - $your_current_age, then add the result to your $years_since_first_appointment
but if($projected_year_of_retirement_based_on_years_of_first_appt falls before you are 60 years old)
    $you_new_retirement_date will now be $projected_year_of_retirement_based_on_years_of_first_appt 
Activity icon

Started a new Conversation Calculating Retirement Date

I have a program where there are staff records, it has a date of first appointment and also a date of birth. There are two modes of retirement in the civil service, if you have served upto 35 years, you will retire, but if your date of first appointment + 35 years is more than 60years of your age, you will have to retire when you are 60, how do i do this calculation please?

someone help

Nov
29
1 month ago
Activity icon

Replied to JSON ARRAYS

I want the UserList to be the key

Activity icon

Started a new Conversation JSON ARRAYS

I have an endpoint that produces this result..

UsersList => 
0 => UserList   {…}
1 => UserList   {…}
2 => UserList   {…}
3 => UserList   {…}
4 => UserList   {…}
5 => UserList   {…}
6 => UserList   {…}
7 => UserList   {…}
8 => UserList   {…}
9 => UserList   {…}
10 => UserList  {…}

Please how do i remove the numeric keys and have them like this..

UsersList =>
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}
    UserList    {…}

thanks alot

Nov
05
2 months ago
Activity icon

Replied to Add To Cart Laravel 6.2

Thanks @nakov , am going to use the darryldecode/laravelshoppingcart package, seems like it has what i need

Activity icon

Started a new Conversation Add To Cart Laravel 6.2

I have a mini shopping system where customers can come and buy some products and make payment online. I have an issue though with something, i don't know how to implement add to cart, i have tried using the Cookies to do that but it just won't work, please can someone else tell me what to do about that? Thanks alot guys!

Oct
02
3 months ago
Activity icon

Replied to How To Check If A Date Is Today Or Yesterday

Thanks alot guys, i appreciate you all...

It was working alright.... I was passing the wrong time in my controller...

Activity icon

Replied to How To Check If A Date Is Today Or Yesterday

I am passing a datetime like this "2019-10-02 09:21:52"

Your answer keeps returning false on both queries

Activity icon

Started a new Conversation How To Check If A Date Is Today Or Yesterday

Hello guys, i need to check if a datetime is either yesterday or today in laravel5.

Sep
09
4 months ago
Activity icon

Replied to Percentage Difference Between Dates

Thank you @mikenewbuild.... Even though i didnt present my question very well, you went ahead to still answer it properly, i appreciate you so much!

Thank you all for all your contributions, i appreciate

Sep
06
4 months ago
Activity icon

Replied to Percentage Difference Between Dates

@cronix and @ i need to find the difference between those two dates but as a percentage value.

I mean i have date1 which is in the past and date2 which is in the future, i need to know the difference between them as an integer or number format then find the percentage difference between them and display.

Activity icon

Replied to Percentage Difference Between Dates

is there anyway i can convert both dates as integers and check the percentage difference between the two numbers?

Activity icon

Started a new Conversation Percentage Difference Between Dates

I need to know the percentage difference between two dates...

$start = "2018-05-06 13:50:20"

$end = "2020-03-06 13:50:20"

I need a result like 30% difference so i can update a progress bar