Back End Web Developer at Esokia Web Agency ltd

Member Since 2 Years Ago

Port Louis

Experience Points

2,180 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
Best Reply Awards
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    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 33
162,820 XP
4 days ago
Activity icon

Replied to Debugging Variables In A Php File

Its a little hard to help without some code of how things are being done.

For example

However, we load all the dropbox information (filename/size/date) into an array, called $files.

When this is done, you cannot dump the $files then?

5 months ago
Activity icon

Replied to Handling Guzzle GET Response Data

I'm not sure that you are supposed to have the "\n" in your response.

I used this json validator ( and found that a valid JSON would be

    "make": "Ford",
    "model": "Focus",
    "VRM": "AB12CDE",

So this should work:

$array_response = json_decode($str, true);
$make = $array_response['make'];

Now you have an array and you can easily access the make like explained

Activity icon

Replied to Send Users Array To Notification

\Notification::send( $users , new EMAIL($info));
Activity icon

Replied to New Metric For Leaderboard

I think an indication of answer quality is already here but not used; the upvote feature. Maybe its due to the fact that you have to hover over the answer to show the number of hearts it has instead of showing it upfront. It would encourage users to "like" answer more. Maybe.

Also this metric as you are proposing (Best reply award count / reply count) * 100. would mean that if you get a best reply on first answer, you would have a 100% score. You'd be more hesitant to answer in order not to ruin your score.

Activity icon

Replied to Include Auth Or Personal Variable In Config.

I have not used this package before, but why exactly are you doing this.

From the ReadMe, you have to publish the config file like so

php artisan vendor:publish --tag=ckfinder

Then for auth, you should use a middleware, also explained in the ReadMe. You could specify the middleware you are using for auth in your config:file.

The key is $config['authentication'];

Activity icon

Replied to How To Order A Product Only Once In Laravel?

When reading the code, its like you are say, the user can only bid ONE time in a category. Is that logic correct?

$order = Order::where('user_id',auth()->id())
            ->where( 'category_id', request('category_id'))

//check if an order is actually returned here when you have already bid. Look at the attributes and check if this looks correct to you

if ($order) {
 alert()->error('Warning', 'You ordered already');
        return redirect()->back();
Activity icon

Replied to Best Way Of Keeping Cart Active After Logout

The cart should be related to the user. When the user logs in again, fetch his cart and set the cart ID to the session again.

Also the user can have a remember_me token in the login page, if he checks this box, when he comes back to the site, he will automatically login again. Then you can fetch his cart when he comes back.

Alternatively, you could set a cookie with the cart id which will stay longer even if the user closes the browser. However, what happens if he clears his cookie?

Activity icon

Replied to How To Pass Object To Validation Rules() Method

You should not allow the user to send validation data. Because you would need to validate the validation. The validations rules should be server side ONLY.

However, you can have a parameter in your request called, rule_type. Then set this value to 1, 2, 3 for example. Then based on this value, you apply different rules

const RULE_1 = 1;
const RULE_2 = 2;

store(Request $request)
if ($request->rule_type == self::RULE_1) {

if ($request->rule_type == self::RULE_2) {

Be careful not to abuse of this and have 10 different rules, maybe you need to have different objects then. A parent class with childrens and each have their own rules would be cleaner.

Activity icon

Replied to Call To A Member Function Connection() On Null.

If your on linux, try running ls -la in the root directory and the bootstrap directory and copy paste the output here.

Secondly, instead of deleting the config file, use the command instead.

Activity icon

Replied to Call To A Member Function Connection() On Null.

You need to change your file permissions to allow the application to generate this file automatically. Check user group as well.

Also use "php artisan config:cache" instead.

5 months ago
Activity icon

Replied to Create An Up To Date Feed

@msiri You're welcome :D

Activity icon

Replied to Create An Up To Date Feed

@robstar Yes, but it can cause unexpected results when I was looking into it. I preferred not to chain just to be on the safe side

Activity icon

Replied to Create An Up To Date Feed

Hey I found the solution here:

Its because reply and news have the same id. So this should work

$merged = new \Illuminate\Database\Eloquent\Collection; 
foreach ($newsReply as $reply)
foreach ($newsOpportunity as $opportunity)
foreach ($newsComment as $comment)
Activity icon

Replied to Using Controller To Open New Window For Redirect

for the text

bla bla bla <span @click="fetchUrl"> Your word </span> bla blla

//the fetchUrl is a function that fetches the url. It hits your show function in your controller. Return a json response containing the url instead of a redirect. 
//On success, use
Activity icon

Replied to Create An Up To Date Feed

try this:

$merged = new \Illuminate\Database\Eloquent\Collection; 
$merged = $merged->merge($newsReply);
$merged = $merged->merge($newsOpportunity);
$merged = $merged->merge($newsComment);
5 months ago
Activity icon

Replied to PhpStorm Methods Not Found In PhpUnit Tests

You might need to set your languages and framework to help phpstorm with discovery

Activity icon

Replied to One Larave Application , Many Databases

One complete answer:

Multi-tenancy concepts can help as well:

How I would do it? Depending on how many companies you actually have, I would have one application for each company, connected to one database. When there are code changes, I would look into application such as Jenkins to deploy the changes to each project, so I dont have to do them all manually. Limit here, would be around 5-10 clients

if more clients, have subdomains for each client. I would then have a middleware on all my routes, to get the subdomain I am on and then set a $connection variable. This way, for this request, all my queries would use only this connection.

Activity icon

Replied to Using Controller To Open New Window For Redirect

If you are using only php, then the way you did it so far is correct. But if you are using JS/Vue, it would be better to send an ajax request instead of redirecting. Send an ajax request to get the link and then open the link in a new window.

Activity icon

Replied to Create An Up To Date Feed

What you have right now are three collections. You can use the merge function to add them together.

Once they are merged, you can then order them by the created_at field if all of them have it.

$merged = $newsReply->merge($newsOpportunity);
$merged = $merged->merge($newsComment);

$sorted = $merged->sortByDesc('created_at');
Activity icon

Replied to Create An Up To Date Feed


I dont really see any way to do this simpler.

You fetch 3 different models and then place them in an array. Maybe you can share what you are doing after with the array and so on. But if thats how far you are going, then i guess that's it. One further suggestion would be to create an associative array instead:

$array['reply'] = ....;
$array['opportunity'] = ....;

That way you dont need to remember which one is first or second.

Activity icon

Replied to Route With Already Predefined Variable

you can retrieve the url like this, in your controller

public function(Request $request)
$url = $request->url();

you can explode the url with delimeter '/'

Then you check the first value to know if it is domains or contact

5 months ago
Activity icon

Replied to Share Data Between Views And Causes Migration Error

Try this

view()->composer('*', function ($view) {
                'all_users' => User::mostActive()->where('active', '=', 1)->get()->pluck('full_name_company_email', 'id'));

You could also create custom view composer provider, which is what I usually use for my projects and I do not have this issue. Doc:

Activity icon

Replied to How To Make Reports With DateTime Data?

Laravel uses the Carbon library to deal with dates:

If you want to use the template for printing PDF, I would suggest using:

Create a blade template and use the package to load this view directly.

Activity icon

Replied to How To Set Queued Email Tries?

Check this section from the documentation

As you can see, you can implement the ShouldQueue interface OR you can queue the email when sending.

use Illuminate\Contracts\Queue\ShouldQueue;

class TextAndButtonEmail extends Mailable, ShouldQueue

public $tries = 5; //for example
5 months ago
Activity icon

Replied to Beginner Routes And Controllers Query


First off, don't apologize for not knowing everything or feeling bad for being a beginner. We all started here and this forum is meant to help each other. You'll love this framework soon enough.

There are several ways to tackle your problem and the correct solution is "it depends on your project"

Route::resource('projects/{project}/tasks', 'ProjectTasksController');
Route::resource('clients/{client}/tasks', 'ClientTasksController');

could become either

Route::resource('project_tasks', 'ProjectTasksController');
Route::resource('client_tasks', 'ClientTasksController');

In your command line, run this

php artisan route:list

you will see all the routes available in your project


// in my route file: Route::resource('shop', 'ShopController');

 | web  | GET|HEAD  | shop                                   | shop.index              | App\Http\Controllers\[email protected]                              | web                          |
|        | POST      | shop                                   |              | App\Http\Controllers\[email protected]                              | web                          |
|        | GET|HEAD  | shop/create                            | shop.create             | App\Http\Controllers\[email protected]                             | web                          |
App\Http\Controllers\[email protected]                            | web                          |
|        | PUT|PATCH | shop/{shop}                            | shop.update             | App\Http\Controllers\[email protected]                             | web                          |
|        | GET|HEAD  | shop/{shop}                            |               | App\Http\Controllers\[email protected]                               | web                          |
|        | GET|HEAD  | shop/{shop}/edit                       | shop.edit               | App\Http\Controllers\[email protected]                               | web                          |

As you can see the "resource" give you six routes. In your code, you will have routes that will clash since you have a dynamic property. I would suggest not to add dynamic properties to your route. It just confuses your further especially when you come back to the project later.

I like the principle that a few lines is better than a single line for code but when you come back to the project, you don't even know what this line is doing. Keep it simple.

Another way you can tackle this is, if you logic is similar

Route::resource('tasks', 'TasksController');

Then send it a parameter in your post or get request to determine if the type of task you are dealing with.

Hope this helped and happy learning! :D

Activity icon

Replied to How To Set Queued Email Tries?

The count is more for the queue than for the jobs. Since you can queue your emails, you can set count for mail send tries as well.

Can you provide more details on what you want to do and associated code?

5 months ago
Activity icon

Replied to Vue Component Is Not Displaying

The div with id app needs to be inside the body


<div id="app">


    <div id="app">
Activity icon

Replied to Vue Component Is Not Displaying

@webfabricant , please copy paste FULL blade pages. Not only the concerned section. The issue seems to be with your templating.

So post FULL page where you use the component and FULL base page ie. layouts/app.blade.php

5 months ago
Activity icon

Replied to Vue Component Is Not Displaying

On this page where you have your component


Do you have a div with id 'app'. Like this:

<div id='app'>
Activity icon

Replied to Laravel 419 Error When Enable Mod_headers For Apache

@surandra Not really sure why it does not work when mod_headers is turned on. I have tried it on my side and it works correctly.

Can you test this on fresh laravel app? Maybe the issue comes elsewhere.

5 months ago
Activity icon

Replied to Could Not Find Driver Laravel 5.8.17 & PHP 7.2.17

Can you post the full stack trace of the error.

Did you site work BEFORE running "php artisan migrate:fresh --seed"

Activity icon

Replied to Laravel Framework Storage Permission

The better solution would be to give your application permission to write to this file by assigning it the right user group.

Here is the full explanation:

Activity icon

Replied to How To Change Title With Vue

Try to use a computed property

    <div class="p-2">
        <button @click="toggle" class="bg-grey-light text-grey-darker rounded-full px-4 py-2" v-on-clickaway="hide">{{title}}</button>

        <div v-if="active" class="w-64 bg-white shadow-md rounded p-4 mt-2 absolute z-20">
            <ul class="list-reset">
                <li class="mb-3">
                    <a href="/fréttir?vinsælt=1">Vinsælt</a>

    import { mixin as clickaway } from 'vue-clickaway';

    export default {
        mixins: [ clickaway ],

        data() {
            return {
                active: false,
                title: ""
      computed: {
        title: function () {
var title = "default";
      // have your condition
if (condition) {
title = "asdf"
      return title;

            show() {
       = true;

            hide() {

       = false;


Activity icon

Replied to User Id

Consider using roles

Maybe this package can help:

Activity icon

Replied to Vue Component Is Not Displaying

To help you better, post the code of the blade file for homepage

Make sure you have something like this

<div id='app'>


Activity icon

Replied to Help Regarding My Blade File

Here's how you can counter that:

In your blade file

//this will pass the user to the component ONLY if logged in

        :user="{{ Auth::user() }}"

Then in your vue file

//You can set the prop to not required and also set a default value
props: {
            user: {
                required: false,
                default: false

Hence you will not have this error: I get a error about the prop can not be empty AND no need to encode this in window

Activity icon

Replied to Puzzling Phenomenon

While I dont have the answer, in browser, the request enters via the public/index.php.

| Turn On The Lights
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
$app = require_once __DIR__.'/../bootstrap/app.php';

| Run The Application
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

whereas for the test, it starts in tests/CreateApplication.

     * Creates the application.
     * @return \Illuminate\Foundation\Application
    public function createApplication()
        $app = require __DIR__.'/../bootstrap/app.php';


        return $app;

Both open the Kernal class.

However there are two different Kernel to take into account.:

  1. The app/Http/Kernel.php

  2. vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php

1 extends 2, if i am not mistaken. In 1, there is a middleware priority, which defines clearly which one to load first. In this one, you can see that Session comes before authenticate.

if you check app.config, you will see that in the providers array, authenticate comes first and then session

I believe the answer lies somewhere within, but sleep calls. Digging in the vendor files sure is fun. Keep this thread updated if you do find the answer

Activity icon

Replied to Laravel 419 Error When Enable Mod_headers For Apache

As you sending the CSRF Token in your POST requests? I believe the answer to this to be Yes, since it works when you disable mod_headers.

Can you post the code of an example post request? It maybe you that you have to send additional headers in your request when you turn mod_headers on.

You could alternatively disable CSRF token in your VerifyCSRF middleware

 protected $except = [
        'post route'
Activity icon

Replied to Help Regarding My Blade File

Why not pass this information as props to a component?

Activity icon

Replied to Which Editor Do You Use To Work?

Phpstorm all the way!

Activity icon

Replied to Laravel On OVH Shared Hosting


I don't have actual experience with OVH personally, but I once worked with a client who had the site hosted on OVH. I was able to run composer and git.

Personally I use bluehost shared hosting and it is pretty decent. Git, Composer, HTTPS with lets encrypt now. Customer Chat service is great. Though you have to wait around 10 mins with customer service, most of their response and guide is more or less okay.

Activity icon

Replied to API Development

@afoysal Is your app loading in the browser at least? If it is not, then the problem is with your installation on the server.

Did you try this in local development to see if you have the same error 500?

5 months ago
Activity icon

Replied to Data Shows In Console, But Not In The View

created() {
            const vm = this;
            .then(response => vm.clients =;

I want to explain this part but I dont have the clear words to actually do so,I would suggest watching the Vue 2 step by step video. Basically its about the keyword "this" in JS. The this in the axios promise is not the same this as outside the promise where your clients exist.