valdinei.lima

valdinei.lima

Member Since 4 Years Ago

Experience Points 115,525
Experience
Level
Lessons Completed 1243
Lessons
Completed
Best Reply Awards 0
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.

24 Sep
1 month ago

valdinei.lima started a new conversation Application Laravel 5.6 With Two SPA Interfaces, How To Correctly Configure Laravel-mix?

my application has two routes, which route the requests to the view, using routes with subdomain, Example:

ROUTES: mgm.application.test -> resources/views/managment.blade.php

  • .application.test -> resources/views/system.blade.php

within each view, I call the due assets:

management.blade.php

<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Bridge">
    <base href="/"/>
    <title>{{ config('app.name') }}</title>
    <link href="{{ mix('/management/css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
    <app></app>
</div>
<script src="{{ mix('/management/js/app.js') }}"></script>
</body>
</html>

system.blade.php

<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Bridge">
    <base href="/"/>
    <title>{{ config('app.name') }}</title>
    <link href="{{ mix('/system/css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
    <app></app>
</div>
<script src="{{ mix('/system/js/app.js') }}"></script>
</body>
</html>

webpack.mix.js

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

let frontend = 'system'
let managment = 'managment'

mix.js(`resources/assets/${frontend}/js/app.js`, `public/${frontend}/js`)
    .setPublicPath(`public/${frontend}`)
    .sass(`resources/assets/${frontend}/sass/app.scss`, `public/${frontend}/css`);

mix.js(`resources/assets/${managment}/js/app.js`, `public/${managment}/js`)
    .setPublicPath(`public/${managment}`)
    .sass(`resources/assets/${managment}/sass/app.scss`, `public/${managment}/css`);

if (mix.inProduction()) {
    mix.version();
}

My problem is in my webpack.mix.js! I need the structure to be created as follows:

public |__managment |__js |__css |__system |__js |__css

but I'm not getting this result

19 Jan
9 months ago

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request?

@martinbean I was calling "$user = auth()->user();" without specifying the guard. Now it worked by passing this way "$user = auth('api')->user();"

thank you so much!

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request?

@martinbean My campaign route returns a attribute "total_points = 0". But if a user who found this route sent a token, then I need to get the user data to return the points of it.

For me to use "auth()->user()" inside controller, I have to go through an "auth: api" middleware, in this case a no longer public route because it would always require a token.

So, I have not added the "auth()->user()" middleware so that you are more public, but I am not welcome to the user on the route.

18 Jan
9 months ago

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request?

Let's forget a previous question. Now, how would I return a User, just knowing the token. How do I ask for Laravel Passport which is the user only informing the a string token?

valdinei.lima left a reply on How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request?

Are you saying: If the user is logged in, show them their own private data when they visit /campaign/ but if they are not logged in, show all of the public items?

The frontend is a SPA in VUE.

The route 'campaign/{slug?}' is public, it can be accessed without a token. However, the SPA can sometimes send token in the header. If there is a token I would like to check return the user.

16 Jan
9 months ago

valdinei.lima started a new conversation How Would I Do A Middleware To Catch The User If There Is A Token And If It Does Not Have A Token, To Continue Without Blocking The Request?

Hello everyone, I have a "domain.com/v1/campaigns" route that returns a list of data. This route does not need to have a token to access. But if there is a token entered in the header, I'd like to return the user's data. I can not use the "auth: api" middleware because it would make the route always require a token, and that would not be the case. The token on this route would be optional. How would I do a middleware to catch the user if there is a token and if it does not have a token, to continue without blocking the request?

18 Nov
11 months ago

valdinei.lima started a new conversation Friends, I'm In Need Of Help To Solve A Problem With Grouped Queries

I need to list all the records (campaigns) of one partner and do a grouping by status type of all the records of a specific partner.

database lists: https://pasteboard.co/GUcTBd8.png

17 Nov
1 year ago
15 Nov
1 year ago

valdinei.lima left a reply on Laracasts Refresh

awesome!!!

09 Nov
2 years ago

valdinei.lima started a new conversation Problems With Domains Without SSL

I have some domains hosted on Digital Ocean using the forge. Some using SSL and some not. As an example I will mention two areas:

site1 https://cbnlondrina.com site2 http://comfortga.com.br

Forge configuration: https://s17.postimg.org/t7z13lefz/Captura_de_Tela_2016_11_09_a_s_14_47_47.png

The problem is that when I add https to a domain that does not have SSL configured, it redirects the site to another domain.

See: https://s22.postimg.org/d47repx0h/Captura_de_Tela_2016_11_09_a_s_14_54_57.png

I tried to access https://comfortga.com.br, appeared a message that has no certificate, I clicked in advanced and processed, the result was, the display of the site cbnlondrina.com.br, but in the navigation bar is the https://comfortga.com.br

How would I make it so that when a user forces http: // comfortga.com.br to redirect to http://confortga.com.br?

08 Sep
2 years ago

valdinei.lima started a new conversation Uncaught (in Promise) TypeError: Cannot Read Property

Hi guys. I'm having a problem to use the data returned after consulting the server.

The error I have to answer, is that I can not read a property that I get. This error occurs only in a production environment. On my computer, so develop is working perfectly.

My Login.vue

<script>
    export default {

        data() {
            return {
                validation: '',
                processing: false,
                form: {
                    email: '',
                    password: ''
                }
            }
        },

        methods: {

            /**
             * Authenticate account user
             */
            login() {

                // Clear errors
                this.$set('validation', '');
                this.$set('processing', true);

                // Send request to api
                this.$http.post(config.api.endpoints.authenticateAccount, this.form).then(
                        response => {
                            var $token = response.data.data.token;
                            var $user = response.data.data.user.data;

                            localStorage.setItem(config.keys.token, $token);
                            localStorage.setItem(config.keys.user, JSON.stringify($user));

                            this.$dispatch('userLoggedIn', $user);
                            this.$set('processing', false);
                            router.go('/');
                        },
                        error => {
                            this.$set('validation', error.data);
                            this.$set('processing', false);
                        }
                );
            }

        }


    }
</script>

Console error

Console error datail

Api response 200

Recalling that locally, everything works. Even when I use 'gulp --production'. Where am I going wrong? Thank you!!!

25 Jul
2 years ago

valdinei.lima started a new conversation Problem Accessing The Https Protocol On A Site That Does Not Have The Certificate

Good morning people. I have a problem on a server hosted in DigitalOcean using Forge.

I have 4 sites on the same server, follows:

  1. sitea.com (ssl active)
  2. siteb.com (ssl active)
  3. sitec.com (without SSL)
  4. sited.com (ssl active)

All are working well, just I found a problem accessing the "sitec.com". The problem is that if I access with the HTTPS protocol, the server complains that it has no valid certificate when accept proceed without the certificate to see what happens, it redirects me to another site "sitea.com"

Can anyone tell me how to solve it?

21 Aug
3 years ago