InspiredPrynce

InspiredPrynce

Member Since 4 Years Ago

Enugu State

Software Manager at Solec Netlinks Nig. Ltd

Experience Points 12,295
Experience Level 3

2,705 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 102
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.

09 Sep
6 days ago

InspiredPrynce left a reply on 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

06 Sep
1 week ago

InspiredPrynce left a reply on 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.

InspiredPrynce left a reply on Percentage Difference Between Dates

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

InspiredPrynce 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

08 Jun
3 months ago

InspiredPrynce left a reply on Using Bogardo Mailgun No Hint Path Defined For Mail

@PSYLOGIC - Yes, it exists there as a markdown mail template

InspiredPrynce started a new conversation Using Bogardo Mailgun No Hint Path Defined For Mail

Hello everyone, am using a laravel library called Bogardo Mailgun to send HTML emails using the generated markdown mails, when i submit the email, i get this error message...

No hint path defined for [mail]. (View: ../resources/views/mails/question.blade.php)

Please how do i fix this error...


//send email
        $mailBag = [
            'view' => 'mails.question',
            'to' => config('mail.admin.support'),
            'subject' => "New FAQ Email",
            'name' => "$request->name with phone number as $request->phone",
            'question' => "$request->question",
            'from' => "[email protected]"
        ];

/**
     * @param $mailbag
     * @return mixed
     */
    public function bogardo($mailbag)
    {
        $response = Mailgun::send([$mailbag['view']], $mailbag, function ($message) use ($mailbag) {
            $message
                ->subject($mailbag['subject'])
                ->to($mailbag['to'], config('app.name'))
                ->trackClicks(true)
                ->trackOpens(true);
        });

        return $response;
    }
02 Feb
7 months ago

InspiredPrynce left a reply on Email Verification

@ARUSZALA - Am using hesto-multi-auth.

31 Jan
7 months ago

InspiredPrynce started a new conversation Email Verification

Hi guys....

I have this multi-auth app and I need a certain guard to verify their email using laravel 5.7 email verification middleware...

Am using hesto-multi-auth.

By default, laravel ships Auth::route(['verified' => 'true']) but multi-auth ships something like this...

Route::group(['prefix' => 'seller'], function () {

    Route::get('/login', 'SellerAuth\[email protected]')->name('seller.login');
    Route::post('/login', 'SellerAuth\[email protected]')->name('seller.login.post');
    Route::get('/logout', 'SellerAuth\[email protected]')->name('seller.logout');

    Route::get('/register', 'SellerAuth\[email protected]')->name('seller.register');
    Route::post('/register', 'SellerAuth\[email protected]')->name('seller.register.post');

    Route::post('/password/email', 'SellerAuth\[email protected]')->name('password.request');
    Route::post('/password/reset', 'SellerAuth\[email protected]')->name('password.email');
    Route::get('/password/reset', 'SellerAuth\[email protected]')->name('seller.password.reset');
    Route::get('/password/reset/{token}', 'SellerAuth\[email protected]');

    Route::group(['middleware' => 'auth:seller'], function(){

        Route::group(['prefix' => 'dashboard'], function(){

            Route::namespace('Seller')->group(function(){

                Route::get('/', '[email protected]')->name('seller.dashboard');

            });

        });

    });

});

Please how do I implement this middleware on the above setup!

Thanks!

15 Jan
8 months ago

InspiredPrynce left a reply on Eloquent Relationship Multiple Connection

@snapey can you please help me out here?

InspiredPrynce started a new conversation Eloquent Relationship Multiple Connection

Hi guys,

I have a multi-connection application. Model Department is on a different connection from model CutOff.

I have a relationship in my CutOff that looks like this

public function department()
{
        $department = new Department();
        $database = $department->getConnection()->getDatabaseName();

        return $this->belongsTo('App\Department', 'department_id', "$database.department.id");
}

So I try to call it like this from my view ...

$cut_off->department->name

I get this error...

 ErrorException (E_ERROR)
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`id` = ? limit 1' at line 1 (SQL: select * from `departments` where `departments`.`uni_main`.`department`.`id` = 2 limit 1) (View: C:\wamp\www\university\resources\views\utme\dashboard\cut_off\index.blade.php)

Please how do I get around this?

Thanks alot guys!

02 Jan
8 months ago

InspiredPrynce left a reply on Random Image

@SERGIU17 - Thank you

28 Dec
8 months ago

InspiredPrynce left a reply on Generating A Route With A Query String Parameter

What the heck? The answer by @sidscorner should have been the accepted one.

21 Dec
8 months ago

InspiredPrynce left a reply on How To Properly Use Cross Database Relationships?

public function your_method()
{
    $database = $this->getConnection()->getDatabaseName();

    return $this->belongsToMany('B', "$database.a_bs", 'a_id', 'b_id');
}

InspiredPrynce left a reply on Laravel Multiple Database Connections

Eloquent protected $connection = 'connection-name'; did the job for me

Database Connection

By default, all Eloquent models will use the default database connection configured for your application. If you would like to specify a different connection for the model, use the $connection property:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Flight extends Model
{
    /**
     * The connection name for the model.
     *
     * @var string
     */
    protected $connection = 'connection-name';
}

InspiredPrynce started a new conversation Laravel Multiple Database Connections

Hello guys, i have a quick question to ask!

I have an application with atleast 3 different databases!

And each database has a user that can login to them and perform certain tasks on the database.

Laravel authentication and models has no place where you can define a connection to use for login.

Please how do I by-pass this!

I want a model UTME to login to UTME database and model ADMIN to login to SCHOOL database and so on...

Thanks guys! I appreciate!

InspiredPrynce left a reply on QR Code Generator

This is very much easier to use...

https://www.kerneldev.com/2018/09/07/qr-codes-in-laravel-complete-guide/

composer require simplesoftwareio/simple-qrcode

03 Dec
9 months ago

InspiredPrynce left a reply on Eloquent Queries

@MUNAZZIL - $class = "Primary 1F";

$parameter = ClassParameter::where('class', 'like', '%'.$class.'%')->first();

dd($parameter)

This is the code, the parameter was passed!

InspiredPrynce left a reply on Eloquent Queries

@MUNAZZIL - It's not working! Please post stuffs that works!

InspiredPrynce left a reply on Eloquent Queries

@Snapey please can you help me out here?

InspiredPrynce left a reply on Eloquent Queries

@MUNAZZIL - ErrorException (E_WARNING) Invalid argument supplied for foreach()

This is what i get when i ran this query...

$parameter = ClassParameter::where('class', 'like', '%'.$class.'%')->first();

InspiredPrynce left a reply on Eloquent Queries

@TYKUS - Yes it does, the issue is not coming from the session part, it's coming from the class part...

InspiredPrynce started a new conversation Eloquent Queries

I have a simple query...

$class = "Primary 1F";

$parameter = ClassParameter::where('class', 'like', '%'.$class.'%')->first();

I have a class parameter stored with class value as "Primary 1"

When I want to fetch it using the query above, it returns null..

Please how do i fetch this row?

12 Nov
10 months ago

InspiredPrynce left a reply on The MAC Is Invalid.

The problem is you generated a new APP_KEY, then if you try to decrypt the old encrypted data it will show the DecryptException: The MAC is invalid.

If you want to decrypt the old data you need to restore your old APP_KEY.

After realizing that, now, adding a new problem there, if you stored new data with another APP_KEY or another encryption method you have a problem on the data because they are mixed on the table.

In case you don't know when do you started with the new encrypt method or differentiate the new encrypted entries, the fastest solution would be reset all the passwords with the new encrypt method.

You can learn more about how Laravel encryption works on the official Laravel docs.

Copy the APP_KEY from the environment it was working dev to the production and the issue was solved. you may want to try it.

InspiredPrynce left a reply on Multi-Auth Page Has Expired Expired

I was forced to disable VerifyCSRFToken middleware! Hope it won't affect me in the future?

InspiredPrynce left a reply on Page Has Expired Due To Inactivity

@SNAPEY - I have tested everything and there is no error! Just plain old html form with @csrf included in it!

InspiredPrynce left a reply on Page Has Expired Due To Inactivity

I was forced to disable VerifyCSRFToken middleware! Hope it won't affect me in the future?

InspiredPrynce left a reply on “The Page Has Expired Due To Inactivity” - Laravel 5.6

I was forced to disable VerifyCSRFToken middleware! Hope it won't affect me in the future?

04 Nov
10 months ago

InspiredPrynce left a reply on Page Has Expired Due To Inactivity

@shez1983 its a simple form submit...

@cronix all of my forms contains @csrf and my sessions are working well... This is a multi-auth application

03 Nov
10 months ago

InspiredPrynce left a reply on Page Has Expired Due To Inactivity

@snapey it's in the post data...

@csrf is included

InspiredPrynce left a reply on Multi-Auth Page Has Expired Expired

Am not uploading a file, am submitting a simple form with the CSRF token available in the request...

InspiredPrynce left a reply on Page Has Expired Due To Inactivity

@tisuchi i ran your command and its still happening yet... @Snapey it still happens even when i submit a normal form as well or even when i resubmit it using page reload...

InspiredPrynce started a new conversation Multi-Auth Page Has Expired Expired

I have a multi-auth application, but whenever I submit some forms, it shows Page has expired due to inactivity and it returns a web guard instead of the logged in guard...

Please @Snapey how do i fix these issues?

28 Oct
10 months ago

InspiredPrynce started a new conversation Page Has Expired Due To Inactivity

I get page expired due to inactivity whenever i upload a file. Please whats wrong with my storage folder and how do i fix it?

Thanks!

InspiredPrynce left a reply on PHP String Manipulation

@DavidStiller thanks alot! It worked!

InspiredPrynce started a new conversation PHP String Manipulation

I have a string like this...

"Export Result for DMGS | JSS 1A | English Studies | 2017/2018"

JSS 1A is dynamic, i.e, it changes depending on the data exported. I only want to remove other parts of the string leaving just JSS 1A or whatever it is that will be placed there...

Thanks alot!

InspiredPrynce left a reply on Voting System With Laravel

Thanks guys, i appreciate

25 Oct
10 months ago

InspiredPrynce left a reply on Voting System With Laravel

@shez1983 thanks for your response, please how can i..

  1. Store their cookies amd check it using laravel
  2. Store their IP address using laravel as well

Thanks

InspiredPrynce started a new conversation Voting System With Laravel

Hello guys, am creating a voting system and the way it works, a user can only vote only once for a particular candidate! The issue is, I don't know how to restrict the users from voting for a contestant just once and once alone!

An insight would be highly appreciated!

Thanks y'all!

25 Sep
11 months ago

InspiredPrynce left a reply on Laravel Query

@Vilfago for President!!

Thanks man! Again!!

InspiredPrynce left a reply on Laravel Query

@jorpedito your code returns just a single subject name, nothing else

"English Language"

InspiredPrynce left a reply on Laravel Query

@Vilfago this is what i got when i ran your code...

 Illuminate \ Database \ QueryException (42000)
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'diocesan.subjects.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from `subjects` group by `name` order by `name` asc)

InspiredPrynce left a reply on Laravel Query

@jorpedito thanks for your answer. It's about longer, I currently have that in the code base but I want a very simplified approach to it with simple query.

InspiredPrynce left a reply on Laravel Query

@Vilfago thanks for your response. I want to list subjects from the database and I don't want the ones with same name appearing, I just want one of them duplicate ones alongside the others

InspiredPrynce left a reply on Laravel Query

@Galavant I have used that method and it returns everything except the ones with the same column name value, it should add one of them to the list.

InspiredPrynce left a reply on Laravel Query

@Galavant that's not what I meant!

I want to perform a query like this...

select everything from table subjects, if a row has the same name value as another row, please ignore that one and proceed to the next one. One you're done, show me all the ones you fetched.

@Snapey, @andreasbakir, @Cronix and @martinbean please help out!

You guys are the best here

InspiredPrynce started a new conversation Laravel Query

I have a table with multiple inputs, some data have the same name in the column name. I want to ignore all the rows that has the same column name value and pick just one! The unique one. How do i do it?

24 Sep
11 months ago

InspiredPrynce left a reply on Array Flatten

@andreasbakir this function doesn't seem to end once. When i use it twice or more, it returns the results in its previous usage. Its doesn't clear its memory, so to speak, how can this be fixed?

InspiredPrynce left a reply on Using A Function Twice

Thanks @Tray2, i've found where the problem is coming from...

/**
     * @param $score
     * @param $type
     * @return mixed
     */
    public static function get_grade_count($score, $type)
    {
        $grade = config('school.grades.'.strtolower($type));

        $grade_analysis = [];

        foreach($grade as $value) {
            $g = $score->where('grade', $value)->count();
            array_push($grade_analysis, [$value . '_point' => config('school.grades.' . strtolower($type) . '_points')[$value] * $g]);
        }

    //the sanitize_array() is the issue, so i changed it to array_collapse()
        //return sanitize_array($grade_analysis);
    return array_collapse($grade_analysis);
    }
}
22 Sep
11 months ago

InspiredPrynce left a reply on Need Suggestion

<input name="surname[]" /> should work