oroalej

oroalej

Member Since 1 Year Ago

Experience Points
5,600
Total
Experience

4,400 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
13
Lessons
Completed
Best Reply Awards
3
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 2
5,600 XP
Sep
24
3 weeks ago
Activity icon

Replied to Why Laravel Can't Find PHP-FFMpeg/PHP-FFMpeg Package?

@shideichis did you follow from step 1 to 3?

Sep
10
1 month ago
Activity icon

Replied to Merging Two Collections Based On Matching Key Values

@suo You can do map collection in here:

$someCollection->map(function($item) {
    $item->lead_details => [] // SomeDataOrConditions

    return $item;
});

Activity icon

Replied to How To Access 1:M Relationship Through M:N?

I want to access the Child's toy ratings with something like this Child::find($id)->toys()->ratings

$child = Child::with('toys.ratings')->find($id);
Activity icon

Replied to How To Get Total Number Of Posts Made By All Users

Your relationship should be like this.

Post.php


public function news() {
  return $this->belongsTo(News::class);
}

News.php

public function posts() {
  return $this->hasMany(Post::class);
}

Then do this:

$news = News::withCount('posts')->get();
Activity icon

Replied to How To Underline Task When Click On It And It Should Be Saved In Database As Completed

Maybe also try learning vue.js? It will make your life easier I promise you.

Activity icon

Replied to More Cleaner Way

Why not create a column in user table that will save the total points? it will only update whenever a user do comment or questions?

Activity icon

Replied to Restrict Access To Website By Location.

Is the GPS technology that accurate that it can detect where you are with precision accuracy?

Jul
16
3 months ago
Activity icon

Replied to GroupBy And Chunk - How Do I Go About It?

Why not start your query in user table?

Like this


  $result = User::with('performances')
        ->get()
        ->each(function($student, $key) {
        // $total_mark = $student->performances->sum('marks') / $student->performances->count();
            // Do some of your config.
        });

In the each() , when you do $student->performances all the test of the user will be listed.

Activity icon

Replied to Can Laravel Handle More Than 10K User At Same Time ?

It will depend on your server configuration, how optimize is your websites.

Activity icon

Replied to How To Show Count Of All Subject With Slug From Post Table?

@mariohbrino If the folder of Post and Subject are in the same folder. You can just call:


public function posts() 
{
   return $this->hasMany(Post::class);
}

Much cleaner and helpful if you are using IDE.

Jul
14
3 months ago
Activity icon

Started a new conversation Eloquent Sync Relationship Create When Not Exist

For example I have an array of ['1', '2', 'Mob Psycho 100'] where as the items 1 and 2 are ids. However the Mob Psycho 100 is new item.

Is there an easy Laravel way to insert the mob psycho and sync it to it's relationship?

Currently, the sync() is only working for the existing data.

Jun
16
4 months ago
Activity icon

Replied to Upwork Clone That Is Build In Laravel?

@devfrey Client want it quick and they doesn't want to build it from scratch cuz it will take time. :(

Jun
14
4 months ago
Activity icon

Started a new conversation How Do You Structure (Folders) Your Project?

Hi All,

Can you share how you structure your laravel folder? like, how do you divide files to different folder. etc..

Really appreciate it.

Activity icon

Started a new conversation Upwork Clone That Is Build In Laravel?

Do you know any Upwork clone that is build in Laravel?

Jun
11
4 months ago
Apr
30
5 months ago
Activity icon

Replied to Polymorphic Relationships With Custom Column Names

How to do this in moprhTo side?

Apr
07
6 months ago
Activity icon

Replied to Vuejs Vue-loader + Laravel (CSS Modules)

@DIGIPRODUCT - Hi @digiproduct ,

Thanks for replying, can you link me the video?

Apr
05
6 months ago
Activity icon

Replied to Vuejs Vue-loader + Laravel (CSS Modules)

So no one in here that uses laravel and vuejs ever try to do this thing?

Mar
25
6 months ago
Activity icon

Replied to Laravel Youtube

Use this package.

https://github.com/alaouy/Youtube

// Get multiple videos info from an array
$videoList = Youtube::getVideoInfo(['rie-hPVJ7Sw','iKHTawgyKWQ']);
Activity icon

Replied to BelongsToMany, But Only Sometimes

You can create another function that have the parameter that you want. just like what @jeffreyvanrossum stated.

or you can do it in the ->with()

example.

YourModel::with(['relationship' => function($query) {
    $query->where('column', condition);
}])->get();
Activity icon

Started a new conversation Vuejs Vue-loader + Laravel (CSS Modules)

Hi All,

I was trying to create a css module using vuejs.

Is there a step by step on how to do in in laravel? It seems like the CSS is not working when I try to do :class="$style.myClass"

<style module lang="scss">
     .myClass {
        background: #000;
    }
</style>
Jan
05
9 months ago
Activity icon

Replied to Querying Related Models

What is the current output of that code? all user shows but some user doesn't have hr_appointments data? maybe you need to add whereHas like this:

public function users($someDate) {
    return User::with('hr_appointments', function ($query) use ($someDate) {
        $query->where('valid_from', '<=', $someDate)
              ->where('valid_to', '>=', $someDate);
    })
    ->whereHas('hr_appointments', function ($query) use ($someDate) {
        $query->where('valid_from', '<=', $someDate)
              ->where('valid_to', '>=', $someDate);
    })
    ->get();
  }

Can you please try this first and let me know if it works.

Activity icon

Replied to How To Submit Form If The User Don't Want To Add HasMany FormItems

@PARTABSAIFZAKIR - lol


if($request->filled('formItems')) {

  $form_items = [];
        foreach($request['formItems'] as $form_item) {
            $form_items[] = new FormItem([
                'form_id' => $form->id,
                'family_name' => $form_item ['family_name'],
                'family_phone' => $form_item ['family_phone'],
            ]);
        }
        $form->formItems()->saveMany($form_items);

}
Activity icon

Replied to Unexpected User (T_STRING)

@POSEIDONRAGE - If you do not follow the good practice for table naming, Sometimes you will encounter these problems.

Try adding protected $table = 'ChildCase'; in your ChildCase Model.

Activity icon

Replied to Ajax Call To Fill HTML Table

Do you know how to use vuejs? it is much cleaner.

Activity icon

Replied to Limiting A With?

The problem with your existing code is that the whereHas only filters the contact's table. So you need to redo your condition inside your with(). Yeah I know, code is ugly.

Oct
21
11 months ago
Activity icon

Started a new conversation How To Use Laravel Request() Inside Vuejs

Hi,

How can I use request() function of laravel inside vuejs. I'm trying to access the url parameters and currently i'm passing the values to javascript variable and accessing it from there. Is there a better way to do this?

Thank you guys!

Activity icon

Replied to How To Stop Eager Loading When Model Already Have $with

I found the problem, there's a getter that query the other tables. just need to refactor it and the issue is now fixed.

@Snapey It becomes a burden when your applicant gets bigger. Too many unnecessary calls. -_-

Oct
17
1 year ago
Activity icon

Started a new conversation How To Stop Eager Loading When Model Already Have $with

Hi,

How can i overwrite the $with in the model without removing it? I found setEagerLoads and it is working great. However, when I tried it to other relationship, it will not work.

select('id', 'name', 'slug', 'professional_category_id')
  ->withCount(['reviews', 'connections', 'ratings'])
  ->NoEagerLoads()       <- this is working, the scope is the same with the address.php
  ->IncludeMediaFile()
  ->with([
    'address' => function($query) {
      $query->select('city_id', 'city_name', 'state_name', 'addressable_id', 'addressable_type')
            ->noEagerLoads();
    }
  ])
                    

Address.php


  protected $with = [
        'city',
        'state',
        'country',
    ];

  public function scopeNoEagerLoads($query) {
      return $query->setEagerLoads([]);
    }

Sep
17
1 year ago
Activity icon

Replied to Recommend Image Optimizer

@martinbean Thanks dude. After checking our implementation, it doesn't have the second parameter so it was using the 90.

Sep
13
1 year ago
Activity icon

Started a new conversation Recommend Image Optimizer

Hi Guys,

Can you guys suggest a good image optimizer? I just saw a website that have 30KB image size in 720px size image while in our website, we have 300px with 150KB size.

Thank you

Aug
09
1 year ago
Activity icon

Replied to Performance Increase Of Route::cache

@bobbybouwmann Thanks for the answer. I think we got around 200 - 300 routes. I'll try to tell this to my boss and let him decide if he want to pursue it since there are some code that needed some refactoring in order to run it.

Thanks again

Activity icon

Started a new conversation Performance Increase Of Route::cache

Hi,

I would like to ask the performance increase of doingRoute::cache. Currently our system cannot do this since we got some code that have closures and i'm planning to refactor the code in order to do Route::cache. Is it worth it?

Aug
03
1 year ago
Activity icon

Started a new conversation Shortcut Of Where.

Hi All,

If you would like to query like this

Modal::where('some_column', 'some value')->get();

You can code it this way.

Modal::whereSomeColumn('some value')->get();

The result will be the same.

Unfortunately, this will only work when you are looking for the equal value. It doesn't work with !=.

Jul
30
1 year ago
Activity icon

Replied to Assign Dynamic Value To Variable

Are you using laravel?

hmm.

maybe try this.

export default { 
  created() { 
    this.getUserCount()
  },
  data() {
    return {
      resultSet:{
        userCount: 0
      }
    }
  },
  methods: {
    getUserCount(){
      axios.get(this.globalUrl+'api/v1/dashboard') 
        .then(function (resp) { 
          this.resultSet = resp.data;
        })
        .catch(function (error) {
            console.log(error);
            alert("Could not load data");
        });
    }
  }
}

Activity icon

Replied to A User Can Listen Only Twice Mp3 File On My Web...How To Do That?

Whenever a user listen to a file, you record it to the database. then just check it using the date if user already reached the limit.

Activity icon

Replied to Laravel Route Conflict

move your search up like this way.


Route::get('/articles/search', '[email protected]')->name('articles.search');
Route::get('/articles/{article}', '[email protected]')->name('articles.show');

If you place /search after @show, the url /search will be recognize as wildcard of @show.

Activity icon

Replied to Assign Dynamic Value To Variable

What are you returning in your API? If you are returning the userCount value i think you should assign it this way.


this.resultSet['userCount'] = resp.data

Jul
24
1 year ago
Activity icon

Replied to How To Add Link To Mail's Body

@bobbybouwmann Thanks for the reply. I tried that but when i view it in the mail, it display the whole code. like <a href="my-url">Click me!</a>

After searching, the problem is that my code are indented. I don't know the reason why indent code render the code RAW.

Activity icon

Started a new conversation How To Add Link To Mail's Body

Hi,

I'm not familiar on how to create mail using the Mail module of laravel.

I was trying to add a link to the mail's body. However, the link was display as raw.

Jun
27
1 year ago
Activity icon

Started a new conversation Got Format Invalid Error In A Japanese Character

Hi,

How can i make the laravel validation accept japanese character? whenever I enter a japanese character in a field, it gives me the format invalid error.

Thank you

Jun
24
1 year ago
Activity icon

Started a new conversation Confused On Eloquent Relationship

Hi all,

I'm confused on where to place the HasMany or BelongsTo in the model.

I have a table named department and directory, department can have multiple directory but directory can only have one department. I placed the foreign key in directory table. Now where do I place the belongsTo or hasMany?

I read an explanation in here regarding this where he use a head and a brain as an example but i cannot find it anymore.

Jun
23
1 year ago
Activity icon

Started a new conversation Laravel Pipeline In Gitlab

Hi all,

I really don't have any idea nor experience on how to setup pipeline in gitlab. It is possible to make pipeline work in gitlab even though my project is only working on my local laptop? Do you have any guide for nubs on how to setup this pipelines?

Regards, Alex

Jun
12
1 year ago
Activity icon

Started a new conversation Library For Point And Reward System.

Can you guys recommend a point and reward system library for laravel if you know any. Or can you guys help me how to structure the database?

We would like to add a point and reward system where a user will be rewarded with points whenever he/she answer a question and that point can be converted to something (reward).

Activity icon

Replied to Laravel Datatable

change your ajax to

  ajax: {
      url: route('teachers.data')
    },

Please make sure that you are calling the correct name.

you can check it using php artisan route:list --name=teachers.data

Activity icon

Replied to How To Calculate The Total Likes Of All Posts Of A User

Try using withCount.

you can read further in here

Jun
11
1 year ago
Activity icon

Replied to How To Create A New Function In Resource Controller In Laravel?

create a function in the controller then add it in the route.

Route::get('purchase_detauls/newFunction', [email protected]');
Route::resource('Purchase_details','Purchase_detailsController');

or you can enclose it in Route::group

May
30
1 year ago
Activity icon

Replied to How To Use V-for Index Inside Formcollective

@click Thank you very much bro!

May
29
1 year ago
Activity icon

Replied to How To Use V-for Index Inside Formcollective

@bobbybouwmann I also tried using question[{{ index }}][answers][1] but it also doesn't work, it says undefined index. when I add @{{}}, it just printed out the whole {{ index }}