Connect with us

Laravel 5.8.8 Released (bugs fixed and new features )




NEWS: Laravel 5.8.8 Released (bugs fixed and new features ) [New  Developer] » Naijacrawl
Photo: Naijacrawl

The Laravel team released Laravel 5.8.8 yesterday with a new query builder method along with the latest fixes and changes in the 5.8 branch.


First, a new Builder::forPageBeforeId() method was added to compliment an existing forPageAfterId().


These methods are useful to query for records before or after a given record. In the pull request author Tim MacDonald illustrates the following example to get the records around a “focused” post:

$posts = new Collection;

$posts = $posts->concat(ChatPost::forPageBeforeId(15, $focused->id)->get()->reverse());

$posts = $posts->push($focused);

$posts = $posts->concat(ChatPost::forPageAfterId(15, $focused->id)->get());



You can see the full list of fixes below, and the whole difference  between 5.8.7 and 5.8.8 on GitHub.


The full release notes for Laravel 5.8 are available in the GitHub 5.8 changelog:



Added Added Illuminate\Database\Query\Builder::forPageBeforeId() method (#28011)


BelongsToMany::detach() with custom pivot class (#27997)

Fixed incorrect event namespace in generated listener by event:generate command (#28007)


Fixed unique validation without ignored column (#27987)



Added parameters argument to resolve helper (#28020) Don’t add the path only if path is empty in compiled view (#27976)



Refactoring of env() helper (#27965)



I am a software developer, like meeting people and love blogging, that's why I developed naijacrawl because that's what I love doing.

Continue Reading
Click To Comment

BE First To Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    How to solve This page isn’t working HTTP ERROR 500 in Laravel




    NEWS: How to solve This page isn’t working HTTP ERROR 500 in Laravel [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    In case you ran into this problem This page isn’t working is currently unable to handle this request HTTP ERROR here is the cause and how to fix it. First, it must not be an error from your code, it is an error from querying large data from your database. So request ran out of memory, to fix it follow this step.

    In your Laravel root project folder locate this file


    Insert this line of code after line 324 

    ini_set('memory_limit', '-1'); 

    or follow the code snippet or image below:

     public function select($query, $bindings = [], $useReadPdo = true)
            return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
                if ($this->pretending()) {
                    return [];
                // For select statements, we'll simply execute the query and return an array
                // of the database result set. Each element in the array will be a single
                // row from the database table, and will either be an array or objects.
                ini_set('memory_limit', '-1');
                $statement = $this->prepared($this->getPdoForSelect($useReadPdo)
                $this->bindValues($statement, $this->prepareBindings($bindings));
                return $statement->fetchAll();

    Continue Reading

    How to Integrate Flutterwave Rave Payment System in your Laravel Applications




    NEWS: How to Integrate Flutterwave Rave Payment System in your Laravel  Applications [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    Hi Folks, I know many laravel developers that have been using Paystack as their payment system have been finding it difficult to integrate Paystack Laravel Package from Laravel 6.0 - 7.0 versions. Today I have a beautiful solution by using Flutterwave Rave Payment System, this process will work on any laravel versions.


    1. Running Exiting Project on Laravel
    2. Create Account on Flutterwave
    3. Then you are good to go

    Lets Begin

    composer require kingflamez/laravelrave

    Once Flutterwave Rave for Laravel is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

    'providers' => [
         * Package Service Providers...

    Also add this to the aliases

    'aliases' => [
        'Rave' => KingFlamez\Rave\Facades\Rave::class,


    Publish the configuration file using this command:

    php artisan vendor:publish --provider="KingFlamez\Rave\RaveServiceProvider"


    Open your .env file and add your public key, secret key, environment variable and logo url like so:

    • RAVE_PUBLIC_KEY - This is the api public key gotten from your dashboard (compulsory)
    • RAVE_SECRET_KEY - This is the api secret key gotten from your dashboard (compulsory)
    • RAVE_TITLE - This is the title of the modal (optional)
    • RAVE_ENVIRONMENT - This can be staging or live. Staging API keys can be gotten here while live API keys can be gotten here (compulsory)
    • RAVE_LOGO - This is a custom logo that will be displayed on the modal (optional)
    • RAVE_PREFIX - This is a the prefix added to your transaction reference generated for you (optional)
    • SECRET_HASH - This is the secret hash for your webhook, this is necessary if you are setting up a recurrent payment

    1. Setup Routes

    Route::post('/pay', 'RaveController@initialize')->name('pay');
    Route::post('/rave/callback', 'RaveController@callback')->name('callback');

    2. Grant CSRF Access to Rave Callback

    Go to app/Http/Middleware/VerifyCsrfToken.php and add your callback url to the $except array

    protected $except = [

    A sample form from your frontend will look like so:

    $array = array(array('metaname' => 'color', 'metavalue' => 'blue'),
                    array('metaname' => 'size', 'metavalue' => 'big'));
    <h3>Buy Movie Tickets N500.00h3><form method="POST" action="{{ route('pay') }}" id="paymentForm">
        {{ csrf_field() }}
        <input type="hidden" name="amount" value="500" /> <input type="hidden" name="payment_method" value="both" /> <input type="hidden" name="description" value="Beats by Dre. 2017" /> <input type="hidden" name="country" value="NG" /> <input type="hidden" name="currency" value="NGN" /> <input type="hidden" name="email" value="" /> <input type="hidden" name="firstname" value="Oluwole" /> <input type="hidden" name="lastname" value="Adebiyi" /> <input type="hidden" name="metadata" value="{{ json_encode($array) }}" > <input type="hidden" name="phonenumber" value="090929992892" /> 
        {{-- <input type="hidden" name="paymentplan" value="362" />  --}}
        {{-- <input type="hidden" name="ref" value="MY_NAME_5uwh2a2a7f270ac98" />  --}}
        {{-- <input type="hidden" name="logo" value="" />  --}}
        {{-- <input type="hidden" name="title" value="Flamez Co" />  --}}
        <input type="submit" value="Buy" />form>

    In this implementation, we are expecting a form encoded POST request to this script. The request will contain the following parameters.

    • payment_method Can be card, account, both
    • description Your transaction description
    • logo Your logo url
    • title Your transaction title
    • country Your transaction country
    • currency Your transaction currency
    • email Your customer's email
    • firstname Your customer's firstname
    • lastname Your customer's lastname
    • phonenumber Your customer's phonenumber
    • ref Your transaction reference. It must be unique per transaction. By default, the Rave class generates a unique transaction reference for each transaction. Pass this parameter only if you uncommented the related section in the script below.

    3. Setup your Controller

    Setup your controller to handle the routes. I created the RaveController. Use the Rave facade.


    namespace App\Http\Controllers;
    use Illuminate\Http\Request;
    //use the Rave Facadeuse Rave;
    class RaveController extends Controller{
       * Initialize Rave payment process
       * @return void
       */public function initialize(){
        //This initializes payment and redirects to the payment gateway//The initialize method takes the parameter of the redirect URL
       * Obtain Rave callback information
       * @return void
       */public function callback(){
        $data = Rave::verifyTransaction(request()->txref);
    dd($data);  // view the data response
          if ($data->status == 'success') {
    //do something to your database
    else {
    //return invalid payment

    Continue Reading

    Laravel 7 comes with Easy Implicit Route Model Binding




    NEWS: Laravel 7 comes with Easy Implicit Route Model Binding [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    Laravel 7 will be out 2020 with new awesome features. You can clean the way routing is been done with one line of code.

    But you can try the dev version by running this code

    laravel new example --dev

    In laravel 7 you can bind routes like this:

    Route::get('/posts/{post:slug}', function (Post $post) {
        // ...

    Currently, Laravel 6 and below requires you to define a getRouteKeyName() method on the model like so:

    class Post extends Model
         * Get the route key for the model.
         * @return string
        public function getRouteKeyName()
            return 'slug';

    You can use the below route binding when you have multiple routes that you want to bind differently.

    For example, the frontend route uses slugs to display posts and backend admin uses ids to manage posts:

    Route::get('/posts/{post:slug}', function (Post $post) {
        // ...
    // Or you could use the default `{post}` here...
    Route::get('/admin/posts/{post:id}/edit', function (Post $post) {
        // ...

    Thanks for reading.

    Continue Reading


    Face of Naijacrawl

    ChukwubuikemSunday ChukwubuikemSunday

    Sunday Chukwubuikem

    Higher - 09061773292