InspiredPrynce

Software Manager at Solec Netlinks Nig. Ltd

Experience

9,775

0 Best Reply Awards

  • Member Since 3 Years Ago
  • 88 Lessons Completed
  • 0 Favorites

19th September, 2018

InspiredPrynce left a reply on Floats Vs Integers • 15 hours ago

@martinbean Thank you so much man! I appreciate the help! It worked like a charm...

You are a life-saver.. You should be in the first aid kit!

InspiredPrynce left a reply on Floats Vs Integers • 15 hours ago

@martinbean please how do i fix this? I opted to round the number up but the points are needed so how do i check for number in between a range...

Thanks

InspiredPrynce started a new conversation Floats Vs Integers • 15 hours ago

I have a function that checks the grade of students...

 public static function get_grade($score)
    {
        if($score>= 70){
            return 'A';
        }
        else if($score>= 60 && $score<= 69){
            return "B";
        }
        else if($score>= 50 && $score<=59){
            return "C";
        }
        else if($score>= 45 && $score<= 49){
            return "D";
        }
        else if($score>= 40 && $score<= 44){
            return "E";
        }
        else if($score>= 0 && 39){
            return "F";
        }
        else{
            return 'F';
        }
    }

I have this score 49.98 and from the function, it' supposed to fall into this category...

 else if($score>= 45 && $score<= 49){
       return "D";
 } 

But it returns "F" which happens to be here...

else{
    return 'F';
}

Please what could be the issue and how do i resolve this?

InspiredPrynce left a reply on "The Page Has Expired Due To Inactivity. Please Refresh And Try Again." • 16 hours ago

I have the craziest fix to this


//errors/419.blade.php

@extends('errors::layout')

@section('title', 'Page Expired')

@section('message')
    The page has expired due to inactivity.
    <br/><br/>
    <a href="{{ url()->previous()  }}" style="text-decoration: none; color: inherit">Click Here To Refresh</a>
@stopassola 

This is better please...

17th September, 2018

InspiredPrynce left a reply on Students Position From Average • 2 days ago

@Vilfago thank you so very much dude! You a life saver! You should be in the first aid kit!

15th September, 2018

InspiredPrynce left a reply on Students Position From Average • 4 days ago

@Vilfago here is the output


array:1 [▼
  0 => array:2 [▼
    0 => 1
    1 => array:21 [▼
      3913936730 => 28.0
      3913239999 => 21.73
      3913659614 => 22.0
      3913160091 => 19.47
      3913885329 => 29.73
      3913582846 => 30.27
      3913645641 => 15.4
      3913087292 => 23.73
      3913646349 => 14.93
      3913280872 => 21.87
      3913028769 => 13.6
      3913747249 => 26.8
      3913049985 => 22.4
      3913083105 => 25.07
      3913282411 => 40.0
      3913662799 => 39.87
      3913261052 => 20.67
      3913865578 => 9.2
      3913062432 => 17.73
      3913395866 => 35.6
      3913059859 => 34.0
    ]
  ]
]

InspiredPrynce left a reply on How To Solve It • 4 days ago

@fam you're submitting the submit button as well?

InspiredPrynce left a reply on Students Position From Average • 4 days ago

@Vilfago there is an error in this


if($result < $current_score){
        $current_score = $result;
        $current_rank += $number_in_position
        $number_in_position = 1;
        $output[$pin] = [$current_rank, $result];

        ++; //What are you incrementing here?
    }

InspiredPrynce left a reply on Custom Redirect After Registration Validation Failure - Call To Undefined Method Illuminate\Http\RedirectResponse::validate() • 4 days ago

Change your function to this

protected function validator(array $data)
    {
    return Validator::make($data, [
           'username' => 'required|string|max:255',
            'email' => 'required|email|unique:users,email,'.Auth::id(),
            'password' => 'required|string|min:6',
            'country_id' => 'required|integer|exists:countries,id',
            'mobile' => 'required|numeric|min:6|max:15',
        ]);
    }

//If you want to retain your form data if validator fails, do this

<input type="text" name="email" value="{{ old('email') }}" required>

Hope this helps! Best regards

InspiredPrynce left a reply on Count The Votes For An Article • 4 days ago

If you are using eloquent relationships, you should be doing something like this...


$article = auth()->user()->articles()->find(1); 
//where 1 is thr article Id

$article->votes()->count();

InspiredPrynce left a reply on Custom Redirect After Registration Validation Failure - Call To Undefined Method Illuminate\Http\RedirectResponse::validate() • 4 days ago

Reverse the registration trait back to the way it was... @Snapey Is right

InspiredPrynce left a reply on Blade - Displaying Unescaped Html • 4 days ago

Can i see your code and the result?

14th September, 2018

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@Vilfago can you help out? At this point am tired... Please help. ???

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@burlresearch there is a slight issue here...

3913261052  10th    51.46
3913936730  9th             51.46

Aren't these two supposed to be 9th then the next one coming becomes 11th?

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@Vilfago thank you as well! I appreciate

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@burlresearch thanks alot! It worked perfectly...

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@Vilfago i want an output like this..

array:10 [
    3101625668 => ["1st", 98.0],
    3101635921 => ["1st", 98.0],
    3913126364 => ["4th", 35.77],
    3913058204 => ["7th", 25.33],
    3101372540 => ["5th", 33.47],
    3913752741 => ["3rd", 40.0],
    3913120054 => ["9th", 20.4],
    3913998755 => ["6th", 26.67],
    3913861492 => ["8th", 25.2],
    3913881854 => ["10th", 19.8]
]

InspiredPrynce left a reply on Students Position From Average • 5 days ago

@Vilfago i would really appreciate it if you can show me a working example. I've been at it since, have sorted the shit outta this array. Please help...

InspiredPrynce started a new conversation Students Position From Average • 5 days ago

Please i have a data like this..

array:9 [
    3101625668 => 98.0,
    3101635921 => 98.0,
    3913126364 => 35.77,
    3913058204 => 25.33,
    3101372540 => 33.47,
    3913752741 => 40.0,
    3913120054 => 20.4,
    3913998755 => 26.67,
    3913861492 => 25.2,
    3913881854 => 19.8,
]

I want to get the students position from the average. The array keys represent the student PIN Number and the value is their average. In array[0] and array[1], the values are the same and i want to get something like "1st" twice then "3rd"...

Someone help me please, have been awake all night working on this...

@andreasbakir thanks for the previous help you rendered! I appreciate man!

I really need help with this one!

InspiredPrynce left a reply on Array Flatten • 5 days ago

@Cronix your example wasn't bad but I needed to retain my keys...

['3190689949' => 98.90]

And @andreasbakir did just that

13th September, 2018

InspiredPrynce left a reply on Array Flatten • 6 days ago

@andreasbakir thank you so much, it worked. So happy, thanks again

InspiredPrynce left a reply on Array Flatten • 6 days ago

@Cronix let me check your code out...

InspiredPrynce left a reply on Array Flatten • 6 days ago

@idtyu what method should I use and how do I use it?

InspiredPrynce started a new conversation Array Flatten • 6 days ago

I have data like this...

array:9 [▼ 0 => array:1 [▼ 3101625668 => 98.0 ] 1 => array:1 [▼ 3913126364 => 35.77 ] 2 => array:1 [▼ 3913058204 => 25.33 ] 3 => array:1 [▼ 3101372540 => 33.47 ] 4 => array:1 [▼ 3913752741 => 40.0 ] 5 => array:1 [▼ 3913120054 => 20.4 ] 6 => array:1 [▼ 3913998755 => 26.8 ] 7 => array:1 [▼ 3913861492 => 25.2 ] 8 => array:1 [▼ 39

I want to flatten the array to something like this..

[$key => $value]

Please Laravel doesn't seem to be of much help.. Someone please help!

19th July, 2018

InspiredPrynce started a new conversation Allow Softdeleted Users To Login • 2 months ago

Please, am creating an application where users can login even when soft-deleted but they won't be able to perform some actions because of their status.

Please how can i achieve this?

Thanks in advance.

22nd December, 2017

InspiredPrynce started a new conversation Sending BTC: GenericServerError A Server Error Has Occurred! Server Response: {"code":500,"msg":"66: Mempool Min Fee Not Met"} • 8 months ago

Am trying to send BTC using BlockTrailSDK and am getting this error response.. Please help me figure out how to overcome this problem..

Thanks

9th October, 2017

InspiredPrynce left a reply on Unique Slug In Editing With Form Request Update Method Laravel 5.4 • 11 months ago

Can i see your Controller function for edit?

InspiredPrynce left a reply on After Middleware • 11 months ago

@ftrillo Your first answer worked fine. I just misunderstood it at first. Thanks alot bro!!

InspiredPrynce left a reply on After Middleware • 11 months ago

@ftrillo it is not working. It's saying The Page Did Not Redirect Properly

7th October, 2017

InspiredPrynce left a reply on After Middleware • 11 months ago

@ftrillo here is my current middleware, note i have 2 guards for the application

`<?php

namespace App\Http\Middleware;

use Closure;

class RedirectIfUnverified { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next, $guard = null) { $response = $next($request);

    switch($guard)
    {
        case 'admin':
            if(auth()->guard($guard)->check()) {
                return $response;
            }
            break;

        default:
            if(auth()->guard($guard)->check()) {
                if(auth()->user()->activated()){
                    return $response;
                }
            }
            break;
    }

    return $response;
}

} `

InspiredPrynce left a reply on After Middleware • 11 months ago

@ftrillo here is my current middleware

`

InspiredPrynce left a reply on After Middleware • 11 months ago

@PawelMysior They can login but they won't be able to see any view except for the account-not-verified-view

InspiredPrynce started a new conversation After Middleware • 11 months ago

I have a multi-auth application in L5.4 and i want to check if the auth user, (that is the web guard not the admin guard), has been activated before they can view their dashboard.

I have been doing something like this in all my controller methods that returns a view

if(auth()->user()->activated() == false){ return redirect()->route('user.unverified'); }

What i want is to be able to somehow write the code once, maybe in a middleware and it will be checked for every request sent to the application by the users!

Thanks for the help!

10th May, 2017

InspiredPrynce started a new conversation Laravel Relationship Issues : Laravel 5.4 • 1 year ago

I have 2 tables in my application...

  1. Users
  2. Conventioners

I have users id in the conventioners table and i want to access their genders from the Users table....

I have like 10 user ids in the conventioners table and 20 users in the users table...

Please how do I access all their genders in the users table...

Thanks alot guys

19th April, 2017

InspiredPrynce left a reply on Lock Screen Middleware • 1 year ago

@d3xtr your controller is not working

12th December, 2016

InspiredPrynce left a reply on Laravel Check If ->get() Returned Anything • 1 year ago

I used

@if(!$result)

@endif

2nd December, 2016

InspiredPrynce left a reply on Request Variable Not Accessible In My View • 1 year ago

@richard This {{ url('/blog') }} will start from the root of the website..

Am in the admin page so my link is localhost:8000/control/dashboard and i want to make it {{ url(CURRENT_PATH/blog) }} without dynamically specifying the path....

I want to use $request->path to get it and append

InspiredPrynce started a new conversation Request Variable Not Accessible In My View • 1 year ago

I wan to do this but am getting an error saying that I don't have access to the $request variable in my view:

How do I get the current path and append it to a new uri

Thanks

InspiredPrynce left a reply on Breadcrumbs • 1 year ago

+1 for the davejamesmiller/laravel-breadcrumbs package. Use it in all my projects.

1st December, 2016

30th November, 2016

InspiredPrynce left a reply on Need A Guidance For My Laravel App • 1 year ago

@zaza https://laracasts.com/series/laravel-5-fundamentals taught exclusively on users and their relationships with items and i think it will help you alot if you calmly go through this cast

You will thank me later

InspiredPrynce left a reply on Alter Table Change Field To LONGTEXT; • 1 year ago

Which Laravel version are you using?

29th November, 2016

InspiredPrynce left a reply on Registration And Login System • 1 year ago

@bobbybouwmann Thanks for the links

3rd August, 2015

InspiredPrynce left a reply on Laravel 5 And Seeds • 3 years ago

None of these works for me; composer dump-autoload, php artisan db:seed.......They all throw some exception error, ""Class UserTableSeeder not found"

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.