Francismori7

Francismori7

Lead IT Management / Lead Developper at Groupe Ratté

Member Since 4 Years Ago

Quebec, Canada

Experience Points
190,260
Total
Experience

4,740 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
1559
Lessons
Completed
Best Reply Awards
53
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.

Level 39
190,260 XP
Aug
01
2 months ago
Dec
01
10 months ago
Activity icon

Replied to Prevent App From Duplicate Requests

Your CSRF token should actually take care of this.

Nov
29
10 months ago
Activity icon

Replied to Laravel Display Restaurants By User_id

You may want to use a hasMany for your user model, if the user can have many restaurants. (Since you pluralize in your controller...)

However, if you are looking to get only the user's restaurant:

$restaurant = auth()->user()->restaurant;
Sep
04
1 year ago
Activity icon

Replied to Composer Update Not Working In Laravel 5.6

I'm having the same issue right now. It was working fine yesterday. I'm upgrading to 5.7 right now and it's hanging.

Using composer update -vvv shows caches downloading, very slowly, but they are.

It ended up working fine.

Aug
16
1 year ago
Activity icon

Replied to Take Only Specified Attributes From Collection.

There's absolutely no reason ->only() would not work here. I suggest you look further into your code base to see where you broke some stuff ...

Aug
08
1 year ago
Activity icon

Replied to Pluck From A Nested Collection?

->map(function($item) { return $item->pls->pluck('strand_id'); });
Jun
26
2 years ago
Activity icon

Replied to Accessor On Demand But Not On Every Results.

@jlrdw definitely not the same method even if it's called with, that's why. I can have a create method on 1000 different objects and they all behave differently.

Jun
22
2 years ago
Activity icon

Replied to Accessor On Demand But Not On Every Results.

Model::setAppends(['accessor'])->where('foo', 'bar'')->get('baz');

Try this.

Activity icon

Replied to How Do I Hide And Show A Bootstrap Modal With Vue 2?

:class="{ in: modalShown }"
data() {
    return {
        modalShown: false;
    }
}

methods: {
    toggleModal() {
        this.modalShown = !this.modalShown;
    }
}
Activity icon

Replied to Repo Pattern Really Worths?

Repositories on my side are useful when the implementation is subject to change, or the queries need to be centralised because they are used multiple times.

Activity icon

Replied to Accessor On Demand But Not On Every Results.

@Borisu with() only works with relationships.

append() works as expected.

Your question makes no sense, since you don't want to use $appends, because it makes it append always, but you want them always... Makes no sense to me.

Query Scope it:

function scopeWithAccessor($query) {
    $query->append('accessor');
}

// ---
Model::withAccessor()->get();
Mar
26
2 years ago
Activity icon

Replied to How To Write Texts To File In Laravel ?

Take a look at Storage:

use Storage;

Storage::put('file.txt', 'Your name');

https://laravel.com/docs/5.4/filesystem#storing-files

Feb
18
2 years ago
Activity icon

Replied to Collect Columns From Collection

What is your expected response? Think about it this way. What do you expect in the end?

Jan
05
2 years ago
Jan
04
2 years ago
Activity icon

Replied to Braintree Payment

Paypal checkout buttons will still work.

Nov
20
2 years ago
Activity icon

Replied to How To Insert Bunch Of Records In Table, Using Transaction Complete Or Rollback Concept?

DB::transaction(function() use ($studentsArray) {
    foreach($studentsArray as $student) {
        Student::create($student);
    }
});
Activity icon

Replied to How To Mass Assignment Laravel Fillable

protected $guarded = [];
Nov
15
2 years ago
Activity icon

Replied to Laracasts Refresh

Awesome

Oct
03
3 years ago
Activity icon

Replied to Moment.js With Vue

@codeus, you missed the point. You can't use global scope variables from Vue's template bindings like this:

{{ moment(user.created_at).fromNow() }}

Having moment in the data helps. My way is to do this:

    //...
    methods: {
        moment(...args) {
            return moment(...args);
        }
    }
    // ...
Aug
28
3 years ago
Activity icon

Replied to Syntax Error PhpStorm?

Because you have not set the JS syntax to support ES2015. You should have a popup up top that lets you do so.

Aug
25
3 years ago
Activity icon

Replied to Laravel5.3 - Controller Auth Problems

@Bounoable using Middlewares to share variables to your views is the recommended approach in most cases, because you don't have to extend the controller over and over again.

Activity icon

Replied to Grouping Laravel 5.3 Notifications

$user->notifications->groupBy('data.screen_id');

Should do the trick.

Otherwise, this will do it:

$user->notifications->groupBy(function ($item, $key) {
    return $item['data']['screen_id'];
});
Aug
07
3 years ago
Jul
27
3 years ago
Activity icon

Replied to How To Combine And Retrieve Values Three Tables

  • Sale Model
    • Needs a items() relationship ($this->hasManyThrough)
  • SaleItem Model
  • Item Model

Review relationships and you'll be set to go.

Jul
25
3 years ago
Activity icon

Replied to Swap Stripe Subscription To New Plan Doesn't Swap Name

You would then use book-club-subscription or something like that and widget-listing-subscription;. Those are STATIC id's that you refer from within your code. The plan name "display name" is not part of Cashier itself, for now.

Jul
16
3 years ago
Activity icon

Replied to Laravel Pagination Not Working With Array Instead Of Collection

@DNAngel It wouldn't be a problem no.

The code you quoted on your post is related to eager loading. You load your model's relationships. In your case, you probably have something along the lines of $status->user or $status->comments, well you could use them there to load them properly from your database without using N+1 queries. See eager loading.

Jul
14
3 years ago
Activity icon

Replied to Laravel Pagination Not Working With Array Instead Of Collection

@DNAngel I made it protected because it was only getting accessed from the very same controller it was declared in.

The MAX_CLIENTS_PER_PAGE "variables" are constants, not properties, hence why they do not have a $ symbol:

class ClientsController extends Controller
{
    /**
     * A page can have a maximum of x clients.
     */
    const MAX_CLIENTS_PER_PAGE = 10;
    /**
     * A client page can have a maximum of x orders.
     */
    const MAX_ORDERS_PER_CLIENT_PAGE = 10;

    /* Rest of class */
}
Jul
11
3 years ago
Activity icon

Replied to Swap Stripe Subscription To New Plan Doesn't Swap Name

You completely missed my point. The name column is an IDENTIFIER, not a "pretty printed name". It's used so you can have multiple subscriptions for each user.

Jul
04
3 years ago
Activity icon

Replied to Need Help With Query In Db With Huge Row

$keyBy = collect();

Product::where('buyer', 0)->where('cat_id',1)->chunk(10000, function($products) use ($keyBy) { 
    $keyBy->merge($products->keyBy('product_id'));
});

dd($keyBy);

This is untested.

Jul
03
3 years ago
Activity icon

Replied to Laravel 5.2 JQuery Ajax Token 500 Error

Your jQuery instance uses this to fetch your CSRF token:

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            }
        })

Yet, your meta tag has a name of csrf-token, not _token.

That is your issue.

Use $('meta[name="csrf-token"]').attr('content') instead.

Activity icon

Replied to Hacked

Your first issue is Wordpress. There are tons of AUTOMATED hacks for Wordpress websites. They just input your URL in the bot and in seconds they uploaded a malicious script that changes your SSH password and uploads itself onto your Wordpress installs.

Make sure you completely wipe out your Wordpress install and reinstall the latest version from scratch. You should be able to keep your database details.

Keep in mind MANY themes/templates will open vulnerabilities to your website since they use RAW PHP code that is unprotected and dangerous if used maliciously.

Activity icon

Replied to Create Rows In Table Based On Number Of Users

if(\Carbon\Carbon::now()->dayOfWeek === \Carbon\Carbon::FRIDAY) {
    \DB::table('rentTable')->insert(
        ['balance' => \DB::table('residentsTable')->count() * 170]
    );
}

If I understood properly?

Jun
24
3 years ago
Activity icon

Replied to The Alert Doesn't Show Up In Laravel 5

@bashy has a good point, the redirect chaining allows with to flash data to the session.

Activity icon

Replied to The Alert Doesn't Show Up In Laravel 5

In your view, you are referencing a Session variable while in your route you were passing a simple variable. The with() method passes data to a view but is never actually stored in the session.

Activity icon

Replied to The Alert Doesn't Show Up In Laravel 5

You are passing an $info variable to your view, instead of flashing it to the database.

Use this:

Route::get('/', function () {
    \Session::flash('info', 'Hello world');
    return view('welcome');
});
Jun
22
3 years ago
Jun
16
3 years ago
Activity icon

Replied to Class 'Braintree_Configuration' Not Found

https://laravel.com/docs/master/billing#braintree-configuration

You have the wrong package installed for Cashier and thus are not getting the right classes required by Spark.

Jun
11
3 years ago
Activity icon

Replied to Can't Make V-cloak Work Anymore. How To Force V-cloak To Stay Longer?

@JohnRivs smart on the exception throwing. I would've went with a timer to check this to be honest. Good job.

Activity icon

Replied to Can't Make V-cloak Work Anymore. How To Force V-cloak To Stay Longer?

It works. It's just fast enough that you don't see it. Try a created() method that hangs a bit and you'll see it.

Activity icon

Replied to AuthorizesResources Not Found

Show us your Controller.php file.

Activity icon

Replied to Swap Stripe Subscription To New Plan Doesn't Swap Name

Cashier's name table is not the plan itself, it's the name of the subscription for your code to use. Think of it as a way to have multiple subscriptions, one for videos and another one for topics for an example:

$videoSubscription = $user->subscription('videos');
$topicSubscription = $user->subscription('topics');

Note that you must specify it when creating a new subscription using newSubscription(). By default, it will be default.

Activity icon

Replied to How To Write This Associative Query In Laravel 5.2 ?

$articles = \Auth::user()->articles()->with('category')->get();

You were referencing the "property" articles, which returns a collection, you would need to use ->articles->load('category'); for this. To use with, you need to reference the method itself (articles()) which exposes a query builder.

Jun
10
3 years ago
Activity icon

Replied to Spark Forms Show Errors For A Split Second?

Use v-cloak on the main div.

Also add to your css:

[v-cloak] {
    display: none;
}

This is known as FOUC to vuejs. v-cloak will be removed by the compiler once it gets processed so you will only have the compiled content visible once it is available.

Activity icon

Replied to Possible To Pass Vuejs Variable Into @include('partial') As Blade Variable

No. You cannot go from a compiled view back to a server side variable (PHP).

Using the event vuejs data in your partial will work without "passing" it since blade doesn't know about it, only the browser itself which compiles it upon reception.

If however your event variable comes from PHP in the same request that the view comes, you can use the $event variable directly without passing through vuejs.

Jun
08
3 years ago
Activity icon

Replied to Spark Vs Cashier

Very far. Spark is built with Cashier of course, but everything is baked in and was made with lots of time and effort from Taylor.

You will, however, be able to reach the same result with Cashier providing you have the patience and knowledge required.

Jun
07
3 years ago
Activity icon

Replied to PhpStorm Autocomplete Not Working With Facade

I also have some issues with it. Some facades have no autocomplete data to them, some do... it's weird.