MUM

Member Since 3 Years Ago

Mainz

Experience Points
10,580
Total
Experience

4,420 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
97
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 3
10,580 XP
Feb
23
3 days ago
Activity icon

Started a new Conversation Integration Of Quasar 2 In Laravel Jetstream Project Fails

Unfortunately, I'm not getting any further with my problem at the moment and hope that someone has one or two helpful hints for me!

I would like to use the Quasar Framework in a project. The project was completely rebuilt with curl -s https://laravel.build/laravel-one | bash. Then I followed the instructions on https://jetstream.laravel.com/2.x/installation.html and installed Jetstream with Inertia. This works without any problems, I can call up the page in the internet browser and everything works. Next, I installed the necessary components for Quasar with npm install [email protected] and npm install [email protected]. I then edited the app.js and adapted it as follows:

require('./bootstrap');

// Import modules...
import { createApp, h } from 'vue';
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue3';
import { Quasar } from 'quasar';

const el = document.getElementById('app');

const app = createApp({
    render: () =>
        h(InertiaApp, {
            initialPage: JSON.parse(el.dataset.page),
            resolveComponent: (name) => require(`./Pages/${name}`).default,
        }),
})
    .mixin({ methods: { route } })
    .use(InertiaPlugin, Quasar);

app.mount(el);

If I then insert a button with <q-btn colour="white" text-color="black" label="Standard" /> in the Welcome.vue file, for example, I get the message Failed to resolve component: q-btn in the JavaScript console.

From another project, still with Vue2, I know that the following setup worked with Quasar:

app.js

require('./bootstrap');
require('../css/app.css');

import { Inertia } from '@inertiajs/inertia';
import { App, plugin } from '@inertiajs/inertia-vue';
import Vue from 'vue';
import './Plugins/Quasar';

Vue.use(plugin);

const app = document.getElementById('app');

new Vue({
    store: store,
    render: h => h(App, {
        props: {
            initialPage: JSON.parse(app.dataset.page),
            resolveComponent: name => require(`./Pages/${name}`).default,
        },
    }),
}).$mount(app);

Quasar Plugin:

/**
 * Imports Quasar + styles
 */

require('quasar-extras/fontawesome');

import Vue from 'vue';
import iconSet from 'quasar/icon-set/fontawesome-v5';
import Quasar, {
    colours,
    dialogue,
    Notify,
    QBtn,
    QBanner,
} from 'quasar';

Vue.use(Quasar, {
    components: {
        QBanner,
        QBtn
    },
    plugins: {
        dialogue,
        Notify,
    },
    config: {
        notify: {},
    },
    iconSet: iconSet
});

Does anyone have an idea what the correct port would look like to make it work?

I think I did something wrong with my port to Vue3 or?

Sep
25
5 months ago
Activity icon

Replied to Best Practice: FirstOrCreate On High Load System

Started a thread at https://github.com/laravel/ideas/issues/2347

I think, related changes to laravel code or documentation are right here.

Sep
24
5 months ago
Activity icon

Replied to Best Practice: FirstOrCreate On High Load System

I even subscribed to it, but I probably didn't read that part ^^ I will do better!

But it would actually be great if the problem is known, if Laravel himself offers an implementation that the problem no longer exists. I have also encountered other problems related to heavy loads: It is great to check with Cache::has if something is in the cache. But in the next moment it might happen that when you fetch something from the cache with Cache::get it no longer exists. This forced us to adapt code to make it suitable for high load.

Activity icon

Replied to Best Practice: FirstOrCreate On High Load System

Incredibly fast your answer! Thank you, that looks very good, we will try it out!

Activity icon

Started a new Conversation Best Practice: FirstOrCreate On High Load System

Hello everybody!

We currently have an interesting problem on a system with higher access rates: We are providing an Api Call, which outputs information with appropriate parameters. At the beginning we have a call in the corresponding controller

    $user = \App\Models\User::firstOrCreate([
      'email' => auth()->user()->email
    ]);

Now we have already had some situations where we found in the logfile the message that the email address could not be added because it already exists (email field is set to unique). In all situations the identical api call is sent three times in a row and then the error occurs. I am convinced that in a fraction of a second the situation occurs that the data set e.g. from the first call has not yet been written, the second call does not find it and tries to create it. In the meantime, the database transaction for creating the record has been executed.

My idea now would be to no longer use firstOrCreate but to execute a search (first) first. If the result is empty, I would create the data set with a Create and if necessary I would generate a short artificial pause with a sleep in the situation to be sure that the data was written. Is that so practical? The alternative would be to create the data sets in advance, but actually I wanted to create the Just in Time to reduce the amount of data to the necessary amount.

What is a good way to proceed here?