Linda Maya

Member Since 4 Months Ago

Experience Points
790
Total
Experience

4,210 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
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
790 XP
May
04
6 days ago
Activity icon

Replied to Error While Installing A Package Through Composer

I am sure I am on the right track. However now, it warns me about another package called spatie/crawler that requires guzzlehttp/guzzle^7.2 if I understanding in a correct way.

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - spatie/crawler[6.0.0, ..., v6.x-dev] require guzzlehttp/guzzle ^7.2 -> found guzzlehttp/guzzle[dev-master, 7.2.0, 7.3.0, 7.4.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (^6.3).
    - Root composer.json requires spatie/crawler ^6.0 -> satisfiable by spatie/crawler[6.0.0, 6.0.1, 6.0.2, v6.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I was thinking.., Would it be the best way to install modelizer/selenium package to an empty project? Or is there a workaround to this?

Activity icon

Replied to Error While Installing A Package Through Composer

Unfortunately, changing guzzlehttp/guzzle , in composer.json did not work.

Activity icon

Replied to Error While Installing A Package Through Composer

Does this have something to do with the following statement?


... but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

and should I change something in the composer.lock file?

Activity icon

Replied to Error While Installing A Package Through Composer

Yes updated as such "guzzlehttp/guzzle": "^6.3", . tried with the composer and gave the results below :

For:

composer require modelizer/selenium "~2.0"
./composer.json has been updated
Running composer update modelizer/selenium
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires guzzlehttp/guzzle ^6.3, found guzzlehttp/guzzle[6.3.0, ..., 6.5.x-dev] but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
    - modelizer/selenium[v2.0, ..., v2.0.2] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires modelizer/selenium ~2.0 -> satisfiable by modelizer/selenium[v2.0, v2.0.1, v2.0.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

For:

composer require modelizer/selenium "~2.0" --with-all-dependencies (-W)


  [InvalidArgumentException]
  Could not find a matching version of package (-W). Check the package spelling, your version constraint and that the
   package is available in a stability which matches your minimum-stability (dev).


require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...
Activity icon

Replied to Error While Installing A Package Through Composer

Do you mean in vendor/composer/InstalledVersions.php file?

There is something like this :


 'guzzlehttp/guzzle' => 
    array (
      'pretty_version' => '7.2.0',
      'version' => '7.2.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '0aa74dfb41ae110835923ef10a9d803a22d50e79',
    ),


Activity icon

Started a new Conversation Error While Installing A Package Through Composer

Hello,

I have some problems with installing a package, that I would like to share with you.

Here is the command

composer require modelizer/selenium "~2.0"

Then I get this;

./composer.json has been updated
Running composer update modelizer/selenium
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - modelizer/selenium[v2.0, ..., v2.0.2] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.0.1).
    - Root composer.json requires modelizer/selenium ~2.0 -> satisfiable by modelizer/selenium[v2.0, v2.0.1, v2.0.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Fine, it tells me to command something like this;


composer require modelizer/selenium "~2.0" --with-all-dependencies (-W)


I do. Then it returns this:


  [InvalidArgumentException]
  Could not find a matching version of package (-W). Check the package spelling, your version constraint and that the
   package is available in a stability which matches your minimum-stability (dev).


Might be simple for you. But hard for me to solve. Do you have any idea?

Apr
15
3 weeks ago
Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

Would I be able to separately pick values, when I flatten the array?

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

Could we escalate this problem somehow?

Undefined array key 1

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

@jlrdw

No actually, same problem when I try the array with index 3 with this foreach function:

There are two arrays under the $wordsset[3] ,

But I get the same error now. How pity.


 @foreach($wordsset[3] as $elements)

              {{$elements}}

  @foreach

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

I was just about to write here my final thank you words. But I did final trial after a normal restart. It worked! Thanks for trying for me. This had happened to me before with the system restart thing.

Now I think we have discovered something. With this kind of error Undefined array key 1, ErrorException you cant really see where the error is coming from.

Thanks.

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

I suppose the things I have done until the dd($wordset); is correct as it shows the array.

It is interesting because I have removed the

{{var_export($wordsset,true)}}

from blade file, and there is not a single variable calling now. But I am still getting the same "Undefined array key 1" error.

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

There is this, stack trace opening in browser. And 59 pages open respectively. None of them is anything that I see my own code.

There is the 55th. page which does not show anything, but on the title it says "1 unknown frame" . somehing mysterious.

Activity icon

Replied to Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

dd($wordsset); gives me exactly this:


array:5 [▼
  0 => array:1 [▼
    0 => 1
  ]
  1 => array:1 [▼
    0 => array:3 [▼
      0 => array:1 [▼
        0 => "1"
      ]
      1 => array:1 [▼
        0 => "1"
      ]
      2 => array:1 [▼
        0 => "scaun"
      ]
    ]
  ]
  2 => array:1 [▼
    0 => array:3 [▼
      0 => array:1 [▼
        0 => "2"
      ]
      1 => array:1 [▼
        0 => "1"
      ]
      2 => array:1 [▼
        0 => "stuhl"
      ]
    ]
  ]
  3 => array:2 [▼
    0 => array:3 [▼
      0 => array:1 [▼
        0 => "3"
      ]
      1 => array:1 [▼
        0 => "1"
      ]
      2 => array:1 [▼
        0 => "chair"
      ]
    ]
    1 => array:3 [▼
      0 => array:1 [▼
        0 => "4"
      ]
      1 => array:1 [▼
        0 => "2"
      ]
      2 => array:1 [▼
        0 => "seat"
      ]
    ]
  ]
  4 => array:1 [▼
    0 => array:3 [▼
      0 => array:1 [▼
        0 => "5"
      ]
      1 => array:1 [▼
        0 => "la"
      ]
      2 => array:1 [▼
        0 => "chaise"
      ]
    ]
  ]
]

Activity icon

Started a new Conversation Undefined Array Key 1, ErrorException While Trying To Pass A Variable To View

sorry for bothering, I was expected to get some results after passing $wordsset to the view with compact. Similar things work in other parts of the project. But here it doesn't

I would be very pleased to hear from you if you have any idea?

in the function


$wordsset = [[1],[[["1"],["1"],["scaun"]]],[[["2"],["1"],["stuhl"]]],[[["3"],["1"],["chair"]],[["4"],["2"],["seat"]]],[[["5"],["la"],["chaise"]]]];

return view('back.editword', compact('wordsset'));

in the blade php


{{var_export($wordsset,true)}}

Activity icon

Replied to Being Stuck At The Same Page While Using Post Method In A Form

Many many thanks! @crovs

I will get an eye checkup appointment for the next week.

Activity icon

Replied to Being Stuck At The Same Page While Using Post Method In A Form

Thanks @Crovs

As you can see , I have divided the blade into 3. But here I paste all of them in page order.



<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>@yield('title','Admin Panel')</title>

    <!-- Custom fonts for this template-->
    <link href="{{asset('back/')}}/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">


    <link href="asset('back/')}}/css/style.css" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="{{asset('back/')}}/css/sb-admin-2.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{asset('back/')}}/keyboard/keyboard.css">

    <link href="{{asset('back/')}}/vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">


    <script src="{{asset('back/')}}/keyboard/keyboard.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>


    <script>
        $(document).ready(function() {
            $(".keyboard").hide();
            $(".keyButton").click(function() {
                $(".keyboard").toggle();
                $('#anId').prop('readonly', !$('#anId').prop('readonly'));
                $('#exit-keyboard').toggleClass("visible");
            });

        });
    </script>
    <!-- keyboard -->

    @toastr_css


</head>





@extends('back.layouts.master')
@section('title','About')
@section('content')



<!-- Begin Page Content -->
<div class="container-fluid">

    <!-- Page Heading -->
    <h1 class="h3 mb-4 text-gray-800">Edit about text</h1>
    <p class="mb-4"></p>


    <!-- Content Row -->
    <div class="row">

        <div class="col-lg-6">
            <form role="form">
                <div class="card panel-default">
                    <div class="card-header">
                        <h6 class="m-0 font-weight-bold text-primary">Edit</h6>
                    </div>


                    <form action="{{route('admin.about-post')}}" method="post">
                        @csrf

                        <input type="text" name="test"><br>

                        <button type="submit" class="btn btn-primary">Save</button>

                    </form>

                    

                </div>

            </form>
        </div>

    </div>

    <!-- Content Row -->

</div>
<!-- /.container-fluid -->

@endsection




</div>
<!-- /.container-fluid -->




</div>
<!-- End of Main Content -->

<!-- Footer -->
<footer class="sticky-footer bg-white">
    <div class="container my-auto">
        <div class="copyright text-center my-auto">
            <span> © {{date('Y')}} </span>
        </div>
    </div>
</footer>
<!-- End of Footer -->

</div>
<!-- End of Content Wrapper -->

</div>
<!-- End of Page Wrapper -->

<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Are you sure to logout?</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">Choose logout to logout</div>
            <div class="modal-footer">
                <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                <a class="btn btn-primary" href="{{route('admin.logout')}}">Logout</a>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap core JavaScript-->
<script src="{{asset('back/')}}/vendor/jquery/jquery.min.js"></script>
<script src="{{asset('back/')}}/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Core plugin JavaScript-->
<script src="{{asset('back/')}}/vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Custom scripts for all pages-->
<script src="{{asset('back/')}}/js/sb-admin-2.min.js"></script>

<!-- Page level plugins -->
<script src="{{asset('back/')}}/vendor/chart.js/Chart.min.js"></script>

<!-- Page level custom scripts -->
<script src="{{asset('back/')}}/js/demo/chart-area-demo.js"></script>
<script src="{{asset('back/')}}/js/demo/chart-pie-demo.js"></script>

<!-- Page level plugins -->
<script src="{{asset('back/')}}/vendor/datatables/jquery.dataTables.min.js"></script>
<script src="{{asset('back/')}}/vendor/datatables/dataTables.bootstrap4.min.js"></script>

<!-- Page level custom scripts -->
<script src="{{asset('back/')}}/js/demo/datatables-demo.js"></script>



<script>
    document.getElementById("anId").focus()
</script>

@jquery
@toastr_js
@toastr_render



</body>

</html>



Activity icon

Started a new Conversation Being Stuck At The Same Page While Using Post Method In A Form

Hello, I have created a simple post scheme, that would suppose to send input value to a function which has $request variable in a controller named about

When I run, I type "1234" into input box and click the button, It appears


http://127.0.0.1:8000/admin/about?_token=okqx4sLozgeA3W21nmCnKg5F7oqPqzm6OGpb8nSe&test=1234 

in the browser address line, not doing anything about the function in controller, and seems to stay at the same page where the form is.

Does anyone have an idea about what the solution could be?

blade:


<form action="{{route('admin.about-post')}}" method="post">
    @csrf

     <input type="text" name="test">
			
     <button type="submit" class="btn btn-primary">Save</button>

</form>

route:


Route::post('about-post', 'App\Http\Controllers\back\[email protected]')->name('admin.about-post');


controller:


class about extends Controller
{

public function editPost(Request $request){


        dd($request); // To test, I should get some results here.


        return redirect()->route('admin.about');


    }

}

Mar
15
1 month ago
Activity icon

Replied to Cannot Find Module '@nesk/rialto'

It is interesting because I have done npm install @nesk/rialto again. It updated and audited in its own way. After that, when I run the code, I am getting the below error now.

Nesk\Rialto\Exceptions\Node\FatalException
listen UNKNOWN: unknown error 0.0.0.0

the last file is: C:\Users\user\Desktop\project-v1\vendor\nesk\rialto\src\ProcessSupervisor.php:307

Mar
14
1 month ago
Activity icon

Awarded Best Reply on How To Click An Empty Space In Goutte?

I have found out that ->link() does not accept any input other than < a > , therefore there has to be a real link to be recognised as a link.

Activity icon

Started a new Conversation Cannot Find Module '@nesk/rialto'

Hello, I am sure I have missed something about it, but I can't find it how? So I have decided to post it here.

I have installed, puphpeteer and rialto to my project file, as it is described. Then I have used the typical example without changing in my controller file.


use Nesk\Puphpeteer\Puppeteer;

class myclass extends Controller
{
    public function dofunction()
    {
$puppeteer = new Puppeteer();
        $browser = $puppeteer->launch();
        $page = $browser->newPage();
        $page->goto('https://example.com');
        $page->screenshot(['path' => 'example.png']);
        $browser->close();
}
}

It was said in rialto documents, I had to do two things. One is this class below, so I have put it in the same controller file with the above function.

use Nesk\Rialto\AbstractEntryPoint;

class FileSystem extends AbstractEntryPoint
{
    public function __construct()
    {
        parent::__construct(__DIR__.'/FileSystemConnectionDelegate.js');
        
    }
}

Then I have created FileSystemConnectionDelegate.js file and put it in the same namespace where my controllers are. The content of FileSystemConnectionDelegate.js is so:

const fs = require('fs'),
    {ConnectionDelegate} = require('@nesk/rialto');

module.exports = class FileSystemConnectionDelegate extends ConnectionDelegate
{
    handleInstruction(instruction, responseHandler, errorHandler)
    {
        // Define on which resource the instruction should be applied by default,
        // here we want to apply them on the "fs" module.
        instruction.setDefaultResource(fs);

        let value = null;

        try {
            // Try to execute the instruction
            value = instruction.execute();
        } catch (error) {
            // If the instruction fails and the user asked to catch errors (see the `tryCatch` property in the API),
            // send it with the error handler.
            if (instruction.shouldCatchErrors()) {
                return errorHandler(error);
            }

            throw error;
        }

        // Send back the value returned by the instruction
        responseHandler(value);
    }
}

At first the Node was not recognised therefore, I had to change 'executable_path' => 'c:\Nodejs\node.exe' and it seems alright.

However now, I am getting the error below error:

Nesk\Rialto\Exceptions\Node\FatalException
Cannot find module '@nesk/rialto' Require stack: - C:\Users\user\Desktop\project-v1\vendor\nesk\puphpeteer\src\PuppeteerConnectionDelegate.js - C:\Users\user\Desktop\project-v1\vendor\nesk\rialto\src\node-process\serve.js

Throwing from this file: C:\Users\user\Desktop\project-v1\vendor\nesk\rialto\src\ProcessSupervisor.php:307

It says it cannot find module '@nesk/rialto' . and I thought I have installed the rialto package with

composer require nesk/rialto npm install @nesk/rialto

I can't solve this problem. Is there something missing on my side?

Activity icon

Replied to How To Click An Empty Space In Goutte?

I have found out that ->link() does not accept any input other than < a > , therefore there has to be a real link to be recognised as a link.

Mar
11
1 month ago
Activity icon

Started a new Conversation How To Click An Empty Space In Goutte?

To click a link with Goutte ,the original document gives an example as below:

$crawler = $client->click($crawler->selectLink('Sign in')->link());

so there is a selectLink function and if there is a text link you can directly type the link inside, as a text and get what you want. However, the area I would like to click is something like the code below. There is no text. In the browser, you can only see an icon.

<div id="Wrap" class="IconWrap">
    <span class="Icon">&nbsp;</span>
</div>

I would be happy to hear from you, if you have any idea.

Jan
12
3 months ago
Activity icon

Awarded Best Reply on 404 NOT FOUND, Resulting From A View, Route, Controller Scheme

Found the mistake,

On the route, I have mistyped {$id} , instead of just {id}

..thanks.

Activity icon

Replied to 404 NOT FOUND, Resulting From A View, Route, Controller Scheme

Found the mistake,

On the route, I have mistyped {$id} , instead of just {id}

..thanks.

Activity icon

Started a new Conversation 404 NOT FOUND, Resulting From A View, Route, Controller Scheme

Hello, I am seeing 404 NOT FOUND page after trying the code below,

Here is my blade code,

<a href="{{route('admin.delete.article',$article->id)}}" title="Delete" class="btn btn-sm btn-danger"><i class="fa fa-times"></i></a>

Here is my route, the route has a prefix called admin

Route::get('/deletearticle/{$id}','App\Http\Controllers\Back\[email protected]')->name('delete.article');

Here is my controller class, which is initially generated as a resource, however for the purpose of deleting a row from the database, a new function called delete is introduced manually. Therefore I am not using the destroy function. I am not introducing a delete method yet, so that I can see the $id on a new page as a test.

class ArticleController extends Controller

{
    public function delete($id)
    {
        return $id;
    }

    public function destroy($id)
    {
        //
    }
}

As you can see above, I am not introducing a delete method yet so that I can see the $id on a new page.. Also when I hower the mouse on the delete link object and click on it, it shows me localhost:8000/admin/deletearticle/9 on the browser, which is correct. But the page is 404 NOT FOUND .

I would be greatful to hear from you, if you have an idea about this problem.

Jan
06
4 months ago
Activity icon

Replied to How To Correct Scattered Pagination Links And Objects View In Browser While Using Pagination() Function In Laravel 8

Yes, I am using bootstrap, and I have added the reference and the method you have given, to the App\Providers\AppServiceProvider It works properly now. The problem is solved! Thank you.

Activity icon

Replied to How To Correct Scattered Pagination Links And Objects View In Browser While Using Pagination() Function In Laravel 8

Thanks..Here it is :

@extends('front.layouts.master')

@section('title','Homepage')

@section('content')


      <div class="col-md-9 mx-auto">

        @foreach($articles as $article)

        <div class="post-preview">
          <a href="{{route('single',[$article->getCategory->slug,$article->slug])}}">
            <h2 class="post-title">
              {{$article->title}}
            </h2>
            <img src="{{$article->image}}">
            <h3 class="post-subtitle">
                {{\Illuminate\Support\Str::limit($article->content,75)}}
            </h3>
          </a>
          <p class="post-meta"> Category : <a href="#">{{$article->getCategory->name}}</a>
          <span class="float-right">{{$article->created_at->diffForHumans()}}</span>
          </p>


        </div>

        @if(!$loop->last)
        <hr>
        @endif

        @endforeach

        {{$articles->links()}}

        <!-- Pager -->

      </div>

@include('front.widgets.categoryWidget')


@endsection
Activity icon

Started a new Conversation How To Correct Scattered Pagination Links And Objects View In Browser While Using Pagination() Function In Laravel 8

I am working on Laravel 8 framework, PHP 8 and MariaDB 10.4.17.

I am using paginate() feature in controller class and {{$variable->links()}} in .blade.php view file.

When testing the outcome on the browser, I am getting the paginator links and objects scattered.

Here is how I use paginate() in controller class :

class Homepage extends Controller
{
    public function index(){

        $data['articles']=Article::orderBy('created_at','DESC')->paginate(1);

        return view('front.homepage',$data);

    }

Here is how I call pagination in my .blade.php view file :

{{$articles->links()}}

Finally, this is the scattered view I get in browser:

https://i.stack.imgur.com/KW3xr.jpg

I would be happy to hear from you, if you have any idea why such untidiness occurs and how to correct it?