reaz

Member Since 1 Year Ago

Experience Points
7,910
Total
Experience

2,090 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
58
Lessons
Completed
Best Reply Awards
2
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 2
7,910 XP
Apr
20
3 weeks ago
Activity icon

Replied to Insert Array Data In Laravel

If you are sure that product_id and category_id will certainly have same amount of element and they are php array, you can use a forloop like this

 $product_id = [1, 2];
 $category_id = [2,3];

    for(i=0;i<product_id.length;i++){
      Order::insert(order_id,product_id[i],category_id[i]);

    }
Activity icon

Replied to Issues With Using Guzzle In Phpunit Test.

The easiest solution i have found to this problem is, make a.env.testing file with all test db and other config. Then before you run the tests, run the following command to

php artisan config:cache --env=testing

Then after you have finished running tests, go back to your normal env

php artisan config:cache

Apr
15
1 month ago
Activity icon

Replied to How To Add Two Resources In Laravel

Or if Collection model have a relationship defined as products , then maybe as follows

public function toArray($request)
    {
        return [
	        .... some other data
        	'products' => new ProductResource::collection($this->whenLoaded('products'))
	        
        ];
    }
Activity icon

Replied to How To Add Two Resources In Laravel

Assuming a collection have have many products, In the CollectionResource ,

public function toArray($request)
    {
        return [
	        .... some other data
        	'products' => new ProductResource($this->collectionRepositoryInterface->getProductsOfCollection($this->id));
	        
        ];
    }
Activity icon

Awarded Best Reply on Access Multiple Relations On A Query

Probably it should be file_salestask, in alphabetical order of the model name. At least that's how laravel will look for the pivot table.

Activity icon

Replied to Access Multiple Relations On A Query

Probably it should be file_salestask, in alphabetical order of the model name. At least that's how laravel will look for the pivot table.

Activity icon

Replied to Get Detailed Information On Record

You need to define relationship on Companion Model for each user1 , user2 , user4 . Otherwise eloquent would not know how relate those information to the user table.

Activity icon

Replied to Access Multiple Relations On A Query

Have you created the file_salestask table? like you previously created user_files table?

Apr
08
1 month ago
Activity icon

Started a new Conversation Is It Possible To Just Swap MySQL With PostgreSQL Without Changing Code?

So far i have been using only mysql with Laravel. I was wondering if it is possible to just swap the db driver to pgsql? Will all my eloquent queries work or do they need to change a lot?

Does anyone have any experience with this? Thanks in advance for your input.

Mar
29
1 month ago
Activity icon

Replied to Laravel With Vue.js Blade

Where is the test variable coming from? vue or php? Are you using vue component inside blade? is this input outside vue component? if it is inside vue component then declare 'brand' as a prop, then simply do

<input type="checkbox" v-model="feat" name="brand" value="brand">

if outside Vue component, then simple blade variable should work.

Feb
18
2 months ago
Activity icon

Awarded Best Reply on Little Error In Documentation

You can make pull request for Laravel Documentation. Here: https://github.com/laravel/docs

Feb
15
3 months ago
Activity icon

Replied to Little Error In Documentation

You can make pull request for Laravel Documentation. Here: https://github.com/laravel/docs

Activity icon

Started a new Conversation Blade Directive On Vue Component.

Hi , I have a Laravel vue hybrid App, where vue components are rendered in blade templates. I have a nav vue component which has a logout button. I am having a hard time implementing the logout function. in my vue component,

<button class="leading-6 ml-2" @click="logout">Log out</button>
            <form method="POST" id="logoutForm" action="/logout">
              @csrf
            </form>

In side vue script tag:

logout() {
      document.getElementById("logoutForm").submit();
    }

When i click the logout button , nothing happens. I can not figure out what needs to be changed. thanks in Advance

Jan
18
3 months ago
Activity icon

Replied to Is @extends Disappearing?

At this very same moment, i am on the same page. I have just installed vue on a breeze application. Since i am already using the component structure with vue, i think it is better to user blade components also. Since it is prefixed by x, there almost no possibility to mix up, though i find the naming convention is a little counter intuitive

Activity icon

Awarded Best Reply on Vue.component Is Not A Function

Hi , thanks for your reply. it is from the \resources\js\app.js infact. But i have i found the problem. In default breeze app layout, script tag is in the head section. I had to move it to just before the end body tag. That solved the problem for me.

  <body class="font-sans antialiased">
        <div class="min-h-screen bg-gray-100" id="app">
            @include('layouts.navigation')

            <!-- Page Heading -->
            <header class="bg-white shadow">
                <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                    {{ $header }}
                </div>
            </header>

            <!-- Page Content -->
            <main>
                {{ $slot }}
            </main>
        </div>
        <script src="{{ asset('js/app.js') }} "></script>
    </body>
Activity icon

Replied to Vue.component Is Not A Function

Hi , thanks for your reply. it is from the \resources\js\app.js infact. But i have i found the problem. In default breeze app layout, script tag is in the head section. I had to move it to just before the end body tag. That solved the problem for me.

  <body class="font-sans antialiased">
        <div class="min-h-screen bg-gray-100" id="app">
            @include('layouts.navigation')

            <!-- Page Heading -->
            <header class="bg-white shadow">
                <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                    {{ $header }}
                </div>
            </header>

            <!-- Page Content -->
            <main>
                {{ $slot }}
            </main>
        </div>
        <script src="{{ asset('js/app.js') }} "></script>
    </body>
Activity icon

Started a new Conversation Vue.component Is Not A Function

I have a fresh Laravel 8 Application with breeze installed . Then i installed vue with npm. Once i load the dashboard page and try load a simple vue component i am getting the error 'Vue.component is not a function' My files are as following

app.js


window.Vue = require('vue');

const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));

const app = new Vue({
  el: '#app',
});



webpack.mix.js

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js').vue()
  .postCss('resources/css/app.css', 'public/css', [
    require('postcss-import'),
    require('tailwindcss'),
    require('autoprefixer'),
]);

What else do i have to do to get vue components to load? I have added id="app" to main div also

Activity icon

Started a new Conversation It Is Possible To Use Vue Router In Only Some Part Of Laravel App?

Hi, I am looking to start a new project(Laravel - Vue) where i am trying to keep as much things as possible on the Laravel side. So the routing will be done with Laravel. I was wondering will it be possible to use vue router in only one page of my app to load some dynamic components, but essentially not making the whole app an spa? Thanks