murilo

murilo

Member Since 4 Years Ago

Ribeirão Preto

Experience Points
31,800
Total
Experience

3,200 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
253
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.

Level 7
31,800 XP
Jun
18
3 weeks ago
Activity icon

Started a new Conversation Vue On Press Tab Behavior , Go To Next ( Select Custom Component )

Hello , I developed a Vue Select Custom component . and my form will be like this

<!-- input one -->
 <input  type="text"  v-model="form.input_one">

<!-- input two -->
 <input  type="text"  v-model="form.input_two">
                                           

<!-- input three ( MY Vue Selection Component)-->
<select-box v-model="form.type_id" ></select-box >

The problem is if I press Tab , It will select first the -

  • Input One
  • After Input Two
  • After go to One again , it will not go to my custom select component .

I wold Like to know how can I change this Tab Behavior , when goes to - three , select my custom component and open it .

like this one - https://vue-select.org/

Thanks

May
06
2 months ago
Activity icon

Started a new Conversation Laravel Order By Eloquent BelongsTo

hello , I have a Product Search and I want order this search by the name of the Owner ( the guy how has registered this product ) .

In my Product I have The Owner Relation Ship -

public function Owner () {
        return $this->belongsTo(User::class, 'user_id');
    }

My Search -

 Product::select(['id', 'folder' ,'title' , 'price'])

->with(['Owner' => function ($query) use ($owner_id) {
                $query->select( 'id' , 'name'  ,'user_id');
            }])
->orderBy('owner.name' , 'desc')
->paginate(20 , ['*'], 'page', 1 );


I tried to oder by - 'owner.name' , but it was not possible . There is any way to make something like that ? Thanks

Mar
23
3 months ago
Activity icon

Started a new Conversation Dynamic Object Name With Javascript

there is any how I make a dynamic object names, something like that -

the result , should be like this -

	{{ getList }} 

      { form.0.list { type: 1 } , form.1.list { type: 2 } }

the function

	 getList(){
                let list = [];
                for(let field in this.items){

                    list.push({
                        'form.' + [list ] + '.list': {
                            type: 1,
                         },
                    
                    });
				return list ;
                }

Mar
16
3 months ago
Activity icon

Replied to Sessions Are Not Saving : Bug In Laravel Core

I had same problem in Laravel 6 , maybe in Laravel 7 it is solved .

Mar
11
4 months ago
Activity icon

Replied to Error Connecting Database

hello @sauravs012 , thanks for the help . but is giving this error -

ERROR 1142 (42000): UPDATE command denied to user 'root'@'localhost' for table 'user'

Mar
10
4 months ago
Activity icon

Replied to Error Connecting Database

hello @siangboon , I have tried that , but it didnt work . The Root user It is able to migrate the database BUT it is not able to select a table . It had never happened that with me .

Activity icon

Started a new Conversation Error Connecting Database

I created a ubuntu server for laravel . I have a root user , that I added in .env file -

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mywebsite
DB_USERNAME=root
DB_PASSWORD=mypassword


then I migrated the database with the command -

php artisan migrate

It migrated ok . BUT , it is givving this error -

Illuminate\Database\QueryException
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select `id`, `title`from `posts` order by `id` asc)

It is saying that I dont have permission with my user root , to select . BUT I had permission to migrate . how could I give permission to it ?

Thanks

Feb
28
4 months ago
Activity icon

Replied to Laravel Passport With Many Models / Multh Auth

@bugsysha , I have found a solution , I dont know if is the best way . this is the link - https://www.youtube.com/watch?v=m0yX5WWKTVg

Feb
27
4 months ago
Activity icon

Started a new Conversation Laravel Passport With Many Models / Multh Auth

Hello , I have a authentication with VUE + Laravel Passport . I have 2 Models , and if I authenticate , I am able to access just one model , I want to access the other model , but I cant , I have those models -

UserCustomer Model 
UserAdmin Model

the model will be like this -

User Customer Model

class UserCustomer extends Authenticatable
{
    use Notifiable , HasApiTokens;
...

User Admin Model

class UserAdmin extends Authenticatable
{
    use  Notifiable , HasApiTokens;
...

Then I have in My Configuration -

'guards' => [
     'customer' => [
            'driver' => 'passport',
            'provider' => 'user_customer',
            'hash' => false,
        ],

        'admin' => [
            'driver' => 'passport',
            'provider' => 'user_admin',
            'hash' => false,
        ],
] ,


 'providers' => [
        'user_customer' => [
            'driver' => 'eloquent',
            'model' => App\UserCustomer::class,
        ] ,
   'user_admin' => [
            'driver' => 'eloquent',
            'model' => App\UserAdmin::class,
        ],
    ] ,


'passwords' => [
     'user_customer' => [
            'provider' => 'user_customer',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],

 'user_admin' => [
            'provider' => 'user_customer',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],

]

Well and I have the oauth_clients table with those data -

id - 2
name- Laravel Password Grant Client
secret - 74vnROSL5FYqhbTzqa4MAXdimeYGTZhJGnxq3GzY
personal_access_client - 0
password_client - 1

Then I go in PostMan and access this URL - http://my-website/oauth/token

with whose credentials -

grant_type -  password
client_id    - 2
client_secret - 74vnROSL5FYqhbTzqa4MAXdimeYGTZhJGnxq3GzY
username   - [email protected]
password   - 123456

It will works , and will Access the UserAdmin Model . BUT if I want to access the UserCustomer Model , it will be not possible ? how could I access the UserCustomer Model ? should I have 2 Clients Grant Type Password in database , one for each model ? I dont know how can I join the database User Client Type Password to the UserCustomer or the UserAdmin Model .

Activity icon

Started a new Conversation Laravel Passport Stopped Working

Hello , I have a problem here . I have a project that I am using Laravel Passport to Authenticate . Well , now it is not authentication any more , I dont know what is wrong . before it was working . It is giving this error message -

{"error":"invalid_grant","error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.","hint":"","message":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}

I am trying to make the authentication with postman , with those credentias -

POST URL - http://test-web-site:8081/oauth/token

grant_type     - password
client_id         -  3
client_secret - al9eZSNIFlY4S2diYl9L6IRWWmKCONzXNVwDX5X9
username     - [email protected]
password      - 123456
Feb
07
5 months ago
Activity icon

Replied to Laravel Session Save Is Not Working With Request

it will not work . I dont know why . I think that is becose it has many requests , in a short time , and the session does not work . maybe is that

Activity icon

Replied to Laravel Session Save Is Not Working With Request

If I do like this ( with setTimeout ) , it will works the session . otherwise , It does not works .

loadPage() {

    
                Promise.all([

                // RESET ALL FILTERS
                    this.$store.dispatch('reset_all_filters') ,

 
                    // EXTRA OPTIONS
                    this.$store.dispatch('load_extra_options') ,

                    // LOAD OPTIONS
                    this.$store.dispatch('load_form_options')

                ]).then((res) => {
              

         let wait = setTimeout(() => {
                            clearTimeout(wait);
                            // THEN I SAVE THE SEARCH SESSION
                          this.$store.dispatch('save_session_search') ,
                        }, 6000)
         });

 });

Activity icon

Replied to Laravel Session Save Is Not Working With Request

Hello @fylzero AND @sinnbeck , after many tries and testing , I start to understand what is happening .

well , In VUE if I load the page and just make this request -

this.$store.dispatch('save_session_search') ,

IT will works . but the problem is that I have other requests before this one to load the page , it is like this

 loadPage() {

    
                Promise.all([

                // RESET ALL FILTERS
                    this.$store.dispatch('reset_all_filters') ,

 
                    // EXTRA OPTIONS
                    this.$store.dispatch('load_extra_options') ,

                    // LOAD OPTIONS
                    this.$store.dispatch('load_form_options')

                ]).then((res) => {
                // THEN I SAVE THE SEARCH SESSION
                this.$store.dispatch('save_session_search') ,
         });

 });




LIKE THIS THE SESSION IS NOT WORKING . but it access the laravel page , I know that access there becose I tested in my console . but it not save the session .

My question is , does laravel limit the session , when make many requests ? I have never seen this .

Feb
06
5 months ago
Activity icon

Replied to Laravel Session Save Is Not Working With Request

I added this code in the Kernel.php -

  protected $middleware = [
...
        \Illuminate\Session\Middleware\StartSession::class,
    ];


ALSO

'api' => [
    \Illuminate\Session\Middleware\StartSession::class, 
            'throttle:3000,1',
            'bindings',
        ] ,


BUT IT DIDNT WORK , it works if I access the url BUT does not work if I send a request from VUE

Activity icon

Started a new Conversation Laravel Session Save Is Not Working With Request

Hello , I am trying to save a session in Laravel with my Request . but it is not working .

this is the session -

  public function save_session(Request $request)
    {
          $request->session()->put('my_session', "it saved one value");
          $request->session()->save();
           return ['successs' => true ];
}

if I access the route of the session like this -

mywebsite.com/save_session

It will works good and save the session . BUT , if I send a request from VUE , like this -

            axios.get(/save_session)
                .then(response => {
                     console.log(response.data); // {successs: true}

                })

It will get my response , BUT WILL NOT SAVE THE SESSION . I dont know what is happen , If I access the route . It works the session . BUT if I send a request from VUE . IT not works .

Jan
27
5 months ago
Activity icon

Replied to SVG Fill , Change SVG Color With VUE

Thanks @ismaile , It worked

Activity icon

Replied to SVG Fill , Change SVG Color With VUE

@ismaile , there is any way that I can change the color of the svg withou change the image.svg with the editor ?

Activity icon

Started a new Conversation SVG Fill , Change SVG Color With VUE

Hello , I have been tryng to change a color of a SVG , with fill , but it is not working . I am doing like this -

 <img :src="'/assets/images/image.svg " :fill="'#FFF'" class="imgicon">

I tryed ad welll to change in the css -

 div.imgicon {
        fill: green !important;
    }

But it didnt changed ,

Jan
23
5 months ago
Activity icon

Started a new Conversation Check If Has Value In An Object Array

Hello , I wold like to know if has a better ways to check if has a value inside an Object that is inside an Array , without make foreach , like this -

    this.verifyHasTitle('Post One'); // TRUE
         this.verifyHasTitle('Post Four'); // FALSE
`

the data -

  data(){
            return {
                posts:[{ id: 1 , title:Post One } ,
                { id: 1 , title:Post Two } ,    
                { id: 1 , title:Post Three } ,  ]
            }
        } ,

the Method -

verifyHasTitle(title_selected){

     for(let prop in this.posts)
        {
            if(this.posts[prop ].title == title_selected){
                return  true;
            }

        }
    return false;

}