ederson

ederson

Member Since 3 Years Ago

Experience Points 7,865
Experience
Level
Lessons Completed 44
Lessons
Completed
Best Reply Awards 4
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

02 Oct
2 months ago

ederson left a reply on Best Way To Get Running Totals Via Eloquent

I tried to solve the same problem a few weeks ago. Ended up doing something like cronix suggests. I didn't do any performance tests but it is very clean. I get the sums with SQL per month and then add the monthly totals in php.

I m happy with it ?

28 Sep
2 months ago

ederson left a reply on Homestead Newbe Questions..

Not a vagrant guru but this

- map: ~/Documents/projects/tests
  to: /home/vagrant/tests

Instructs homestead to copy your local Documents/projects/tests in the vm's Filesystem. This doesn't exist in your actuall file system and that is why you cannot locate the path home/vagrant/tests.

So you can either connect through ssh and access the files in home/vagrant/tests or using explorer go to Documents/projects/tests

20 Sep
2 months ago

ederson left a reply on Separating API Controllers And Web Controllers

Because your controller extends App\Http\Controllers\Controller

ederson left a reply on Form Request: The Request User In Null

stupid stupid stupid !!!!!!!!!!!!!!!!!!!!!

i use the api route file and i for some strange reason i assumed that auth:api is applied by default !

thanks for the help!

ederson left a reply on Form Request: The Request User In Null

thanks tykus but i ve tried it already

request()->user() returns null

I've checked that the $user passed in actingAs is as actual user

ederson left a reply on Form Request: The Request User In Null

Sorry i should have added it in the first place It is a very simple test

$this->call('POST', 'api/goup', ['name' => 'Name','team'=>'team_id']);

$this->assertEquals(false, $fails);

then in the form request i extend the validator and access request()->user()

without the custom rule it works

ederson started a new conversation Form Request: The Request User In Null

The task is to test form requests. In the general case it works fine.

There is a problem with one request where a custom validation rule is based on the user who made the request

In this case request()->user() is always null So far i tried 1)$this->be($user); 2)$this->actingAs($user); 3)manually login in a user

all failed.

any ideas on what i am doing wrong ?

15 Sep
2 months ago

ederson left a reply on "normal" Php Project With Laragon Possible?

Laragon has actuall nothing to do with laravel. Laragon is just an all in one package like xampp which makes setting up a server really easy.

After that you arrle free to use the server as you like

07 Sep
3 months ago

ederson left a reply on How To Push The Laravel Project To Server Using PuTTy In Window System?

Just follow the instructions and set the correct paths and permissions

it is not complicated

https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa

05 Sep
3 months ago

ederson left a reply on Why Laravel Dropped Elixir? Why Forcing Vue.js? What Is It That You Are Trying To Fix?

I don't get the point.... I have no idea about Vue, I dont use view I couldn't care less about view...

I just develop my ideas using whatever part of laravel I need. Nobody forces me to use Vue or passport or whatever.

Even if there is some kind of financial connection to Vue then good for Taylor. He is not taking my money...

15 Aug
3 months ago

ederson left a reply on Is Laracast Becoming Unreliable

I have a couple of a answered questions but asking from volunteers to work like payed support is irrational.

I think we take for granted things we shouldn't....

10 Aug
4 months ago

ederson left a reply on Custom Model Events And FireModelEvent

Thanks for the reply

I am talking about custom model events which are defined in & observables and cannot be automatically triggered.

But I think you solved the problem... Although I went through the source code of fireModelEvent I see that the function is protected.

Thanks ?

09 Aug
4 months ago

ederson started a new conversation Custom Model Events And FireModelEvent

There must be something embarrassing i am missing here

I have set up a few custom model events and an observer.

When i dispatch one of the event like this

    $this->fireModelEvent('someEvent"):

everything works perfectly

when i try to use the events in a controller though it is not workin

$m=Model::find(1);
$m->fireModelEvent('someEvent");

Call to undefined method Illuminate\Database\Query\Builder::fireModelEvent()

it is not making any sense to me so any help to understand what i am doing wrong will be highly appreciated

16 Jul
4 months ago

ederson left a reply on Append Prefix To URL Dynamically

He did.. Unless you mean actually code it for you...

Anyway

IMHO better solution would be to use named routes

01 Jul
5 months ago

ederson left a reply on How Only Allow Authenticated User To Do API Request?

You have to create the token yourself

20 Jun
5 months ago

ederson left a reply on Laravel Echo Not Listening

I m in on the phone so I am maybe missing something but it looks like you are broacasting an event but you are listening a private channel

ederson left a reply on Unable To See Broadcast Notification?

Check if he notification is sent.

19 Jun
5 months ago

ederson left a reply on Laravel Echo Not Listening

localStorage.debug = '*';

Type this in console. Helped me a lot finding problems with Socket and echo

ederson left a reply on Unable To See Broadcast Notification?

I had the same issue. I kept trying things and suddenly it worked. I think restarting the queue helped.

Are you sure you are subscribed to the private channel?

Try localStorage.debug = '*'; It helps a lot debugging socket problems

16 Jun
5 months ago

ederson left a reply on Trying To Understand The Mentality

What topvillas said... We all were there... I still am.

Having said that I hate it when someone treats the forum as a free coding service where people will complete any task requested.

12 Jun
6 months ago

ederson left a reply on Is There Any Solutions To Delay Between Each Events ?

Sorry , I wan't clear... Typing on the phone is a "§%$§"$%

Instead of one job to send 100 emails , create 20 'subjobs' for emails 5 and delay each subjob

I think this way we override the server's limit but i am not sure if it is proper way of handling such a problem

ederson left a reply on Is There Any Solutions To Delay Between Each Events ?

what about despatch($sendJob)->delay() ?

11 Jun
6 months ago

ederson left a reply on Event/Listener Vs Job Vs Inline?

I've been struggling with questions like this too...

I think that event/listener would be overengineering unless you need to do more than just subscribing to the newsletter. If it is just that then I would just use the controller.

I doubt there are significant performance advantages with any method. What makes the code more readable and easier to maintain.

05 Jun
6 months ago

ederson left a reply on Web Scraping With Laravel: Goutte Or Guzzle?

You don't necessarily need guzzle to open the Web page. Guzzle makes http requests like the one you need to open the Web page. Goutte could also open a Web page with a different approach which may fail. After opening the page guzzle is useless where goutte allows you to go through the Dom structure

30 May
6 months ago

ederson left a reply on Learning Laravel

Do you have subscription. Free users can't download videos.

Looks like you want everything served on a plate... Thyrosis has a point

17 May
6 months ago

ederson left a reply on Windows 10 Laravel Dev Environment

Homestead can be a pain in the a$$ to make it work. Laragon for example in 10mins is ready to go

But running a win webserver means that you may not be able to use certain features. For example Horizon won't work

08 Apr
8 months ago

ederson left a reply on How To Make A Api Call To Third Party Within Laravel Controller?

sorry i am using the phone and i cannot format this correctly

get GuzzleHttp\Client

then in your controller

$apiCall=new Client; $response=$apiCall->get($url);

ederson left a reply on How To Get Data With Third Party API ? Which Api Was Created By Other Company ?

Are you asking in laracasts.com how to watch a laracasts.com video without subscription !??!

there is no other way to watch the video.

23 Mar
8 months ago

ederson left a reply on Laravel Open View Using Ajax

I do it this way too but i'd like to learn the proper way ....

Where do I store the html code to format the data? Keeping html code in the js file doesn't look right to me.

22 Mar
8 months ago

ederson left a reply on [Macbook] Is The Macbook Pro 13" Good For Web Development

I think you won't have a problem just some learning time to get used to iOS. My only "objection" is about the screen size ... Maybe because of the way I work but I prefer to have my editor , prompt and the browser open and visible on the screen , on a 13" I ve found this to be inconvenient

16 Mar
8 months ago

ederson left a reply on Installing Homestead Issues On Windows

I wouldn't call nightmarish procedure the homestead installation on windows and I can assure you I am not an internt guru .....

08 Jan
11 months ago

ederson left a reply on Vagrant\Homestead - Setting Up Multiple Php Versions

Thanks cronix..

I realised this a bit after posting here .... I knew a was missing something obvious

ederson left a reply on Vagrant\Homestead - Setting Up Multiple Php Versions

sorry to hijack but i have the same problem and it is driving me nuts!

i need to use php 7.1 instead of 7.2

so i destroy the vm declare the php version for the project : php: "7.1" git fetch


remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/laravel/homestead
   1be508a..241c926  master     -> origin/master

git checkout v7.0.1

HEAD is now at 0d0082e... ? ? Tagging v7.0.1 (#750)
M       composer.lock
M       resources/Homestead.yaml

and the vagrant up....

php -v keeps saying 7.2 !!!

i am obviously doing something wrong here but i have absolutely no idea what......

20 Nov
1 year ago

ederson left a reply on Define New Custom Relationship Class

That did it the trick ....... Thanks again

ederson left a reply on Define New Custom Relationship Class

I don't have code that actually does something meaningful.

I was just testing things so i copied the code from hasMany and changed the name to of the class to HasManyCustom

Then in my model i use it the normal way

public function transactions1() {
      return $this->HasManyCustom('App\Transaction');
}

I get the exception :

Illuminate \ Database \ Eloquent \ RelationNotFoundException
Call to undefined relationship [transactions1] on model [App\Category].

The problem happens here vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php

 Relation::noConstraints(function () use ($name) {
            try {
                return $this->getModel()->{$name}();
            } catch (BadMethodCallException $e) {
                throw RelationNotFoundException::make($this->getModel(), $name);
            }
        });

Going through the code i found that the relationships are defined here vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasRelationships.php

but i don't want to touch core files

now that i describe the situation i think i could extend the HasRelationships trait ......

Thanks robrogers3 :D

19 Nov
1 year ago

ederson started a new conversation Define New Custom Relationship Class

I am trying to create custom relation class. Possibly i don't need to but i is a nice opportunity to learn something .... So I went though the predefined classes like hasMany etc to understand how to create my custom class.

What i can't understand is where do i need to declare the new class so laravel knows about it.

I tried including the new class but it is not recognized as a relationship (RelationNotFoundException)

23 Oct
1 year ago

ederson left a reply on Debugbar Shows Over 300 Queries

My idea was that you could cache it for a few seconds so they won't be repeated in the same request ...

I had a similar problem and caching solved but maybe your data change faster

ederson left a reply on Debugbar Shows Over 300 Queries

Wouldn't caching the queries help ?

26 Aug
1 year ago

ederson left a reply on Mystery Database Connectivity Error.

I haven't faced the problem since my last post but i haven't found the cause. My guess is that it was caused by my code and not laravel. Since i made some changes to optimize my code the problem disappeared

17 Aug
1 year ago

ederson left a reply on Mystery Database Connectivity Error.

I jinxed it ...... Got the same error

ederson left a reply on Mystery Database Connectivity Error.

I am facing the same issue. I've change db_host to localhost and it so far it seems to be working but i want to wait a few days before calling a solution

29 Jul
1 year ago

ederson left a reply on Config('value') Is Not Working On Cron(laravel Scheduler)

i decided to restart the server..... it fixed it!

ederson left a reply on Config('value') Is Not Working On Cron(laravel Scheduler)

Could you try php artisan queue:restart ?

28 Jul
1 year ago

ederson left a reply on Config('value') Is Not Working On Cron(laravel Scheduler)

I face the same issue.... I'm bumping this thread maybe someone has a clue

ederson started a new conversation Weird: Queued Job Seems To Be Cached

Sorry if the title it misleading but i have no idea how toi describe this.....

I"ve spent most part of the day with this problem and it doesn't make any sense ....

I have a job that uses alaouy/Youtube (i dont't think it is important).

When i execute the job directly everything runs smoothly. If i use a queue (database) things start to get weird.... The script throws an exception about not finding the api key. Trying to solve this i've tried many things but i always got the same exception.

I got tired and frustrated so i started trying 'stupid' things ... For example changed the exception message, removed the exception etc always getting the same output... I even removed the package which should cause a different error,right ?

No,i still get the same exception.

I guess i am missing something about the way queued jobs are executed .... Any ideas would be highly appreciated

22 Jun
1 year ago

ederson left a reply on Adding Animated Preloader While Job Is In Progress

The only way i know is to make an ajax request , show the spinner , wait for the response , hide the spinner

for example (a very rough one that may contain errors i hope you'll go easy on me :) ) you have a link

<a id='action'>Do something</a>
$("#action").click(function(){
    showSpinner();
    $.ajax({url: "test.php", success: function(result){
    hideSpinner();  
        $("#div1").html(result);
    }});
});

clicking the link calls the showSpinner function you have defined somewhere makes the request and on success it hides the spinner

20 Apr
1 year ago

ederson started a new conversation How To Forget A Group Of Cached Keys

I have a bunch of keys in the form somekey-userID under certain conditions i need to delete all of somekey- keys (not the whole cache)

Unfortunately i can only user file cache so tags are not available to me

I ve found an old post suggesting dot notation (somekey.userID) but it doesn"t work.

Fetching all user IDs and looping creating every key works but then it negates the advantages of caching in the first place

Is there an efficient way of doing that ?

18 Apr
1 year ago

ederson left a reply on How To Test Facebook Login Implemented By Socialite

The instructions are very helpfull. I don't know where you find difficulties

You can check this out too ,it is exactly what i did.

https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-facebook-login.html#.WPXiVdKLS70

I have a website in development on my local server there is no public ip nor a domain name but instead i used the local url like the one on the example.

ederson left a reply on How To Test Facebook Login Implemented By Socialite

I was able to test it using as callback url a local ip on my local test server