Neewd

Neewd

Member Since 7 Months Ago

Experience Points 1,090
Experience
Level
Lessons Completed 6
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.

01 Nov
2 months ago

Neewd left a reply on Controller Methods Called Multiple Times

It seems like my multiple calls are triggered by my Vue components. But I don't know how it's possible ...

https://imgur.com/a/kgPKirH

29 Oct
2 months ago

Neewd left a reply on Controller Methods Called Multiple Times

But when I look other website made with Laravel like https://wave.devdojo.com/ or Spark, when I toggle the network debug tools I see just one request :o

Neewd left a reply on Controller Methods Called Multiple Times

How to disable such behaviour ?

28 Oct
2 months ago

Neewd left a reply on Controller Methods Called Multiple Times

Does someone knows from where the problem could come from ?

26 Oct
2 months ago

Neewd left a reply on Controller Methods Called Multiple Times

Hello @munazzil

Thanks for your answer !

Here is my web.php


// Authentication routes
Auth::routes();

// Protected routes
Route::group(['middleware' => 'auth'], function() {
    Route::get('/proposer-trajet', '[email protected]')->name('proposer-trajet');
    Route::group(['prefix' =>  'dashboard'], function() {
        Route::get('/', '[email protected]')->name('dashboard');
        Route::get('settings', '[email protected]')->name('settings');
        Route::group(['prefix' =>  'settings'], function() {
            Route::get('/api', '[email protected]')->name('api')->middleware('admin');
        }); 
    });
});

// Unprotected routes
Route::post('/recherche-annonce', '[email protected]');
Route::get('/recherche-annonce', '[email protected]');
Route::get('/annonce/{id}', '[email protected]');

The duplicate of /recherche-annonce is due to the possibility for the user to go this page directly by typing the url in the browser (in get) and from a post (with parameters in post from a form)

I looked in my middleware to see if they're any double next() but except my AdminMiddleware everything is from Laravel directly.

Neewd started a new conversation Controller Methods Called Multiple Times

Hello,

I have a quite annoying problem. When I am looking the network from the debugs tools on chrome, I see that my rotue is called three times ...

https://imgur.com/a/0kcfi8k

When I look into my code it's just a F5 or when I click on a button from a form who have the route in the href.

I see I have different initiator but I don't understand why such things are happening ?

25 Oct
2 months ago

Neewd left a reply on Vue Not Working When I Am Going Back

So, I didn't find the problem, and the store solution isn't the good one I think. So when my component first load, it works well, but when I come back from the next page, I got Error in data(): "ReferenceError: google is not defined"

Here is my data

    data() {
        return {
            team : {
                id: '',
                name : ''
            },
            city : {
                lat : 0,
                lng : 0
            },
            googleData : google
        } 
    },

I have also the "Property or method "team" is not defined on the instance but referenced during render"

If anyone have an idea ...

21 Oct
2 months ago

Neewd left a reply on Vue Not Working When I Am Going Back

Hello,

It seems that my error are linked to my new google.maps where google is undefined, I'll put that in a Vuex to store that :)

Neewd started a new conversation Vue Not Working When I Am Going Back

Hello,

Here is a little context, so I have my Laravel and Vue website working together. All my template are in blades.php files where I write my Vue components as inline-template.

So I only use the laravel router to go on my app.

When I click, on the different buttons, actions and forms, the controllers are called and everything is loading correctly but when I try to go back (like "/" to "/login, then then "/" via the back button in my browser) it seems that my Vue components are not rendered ...

<!---->

All my Vue components seems to stay in this state ...

But I don't know how and why ?

If someone could help it would be great

Thanks

26 Sep
3 months ago

Neewd started a new conversation Installation Error When Migrating

I just got Spark, and after I tried to migrate the tables, I got the following error :

Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table announcements add primary key announcements_id_primary(id))

In the older version of Laravel I was used to correct that by adding a line in the boot() of the AppServiceProvider.

Schema::defaultStringLength(191);

But the line was already there so I don't know where the problem. I didn't touch to any file so ...

If anyone had this issue I'll be glad to hear the solution !

Thanks

25 Sep
3 months ago

Neewd left a reply on Laravel + Vue : How To Verify The User Is Connected

Let me clarify the situation. or at least try to.

So, when my parent component is mounted, I would like to store via Vuex the fact that a user is connected or not, to hide the "Sign in" "Signup" buttons and display a default avatar.

Till then I was making a request to the back to retrieve the Auth::user() but it seems to be the bad way to do this, and I notice two tokens are created when I log my user. "Laravel_token" when it's a normal connection, with a "remember_token" when the user wants to be remembered at the browser closing.

So I wanted to check those cookies.

It's the first website I am fully coding so I try to do my best to assimilate every process the best way I can.

Thanks a lot again !

24 Sep
3 months ago

Neewd left a reply on Laravel + Vue : How To Verify The User Is Connected

Oh ok, it's a lot more clearer to me ! I have on more question, I was thinking the httpOnly true / false of the laravel_token was on the Session.php file, but I switch it, but even with a cache clear, the laravel_token is still unavailable to Javascript because the flag is still on :/

Neewd left a reply on Laravel + Vue : How To Verify The User Is Connected

OK so if it’s only an header to ado to almost each request (if i listen you) ! It’s basically an encrypted key or something else ?

Neewd left a reply on Laravel + Vue : How To Verify The User Is Connected

I am not quite a security expert so I don’t Know where to look. Does the Laravel documentation talk about those stuff ?

Neewd left a reply on Laravel + Vue : How To Verify The User Is Connected

It’s a security against XSS attack so we should let him on no ?

Neewd started a new conversation Laravel + Vue : How To Verify The User Is Connected

Hey,

I have quite newbie question around here. When I log my user, Laravel store a "laravel_token" and if we want also a "remember" token in the cookies.

So when the user close the page, or the browser, how could we check the cookies, to see if the connection is still available ? Because the cookies are created with the httpOnly flag, so they're disabled for javascript checking ...

Thanks for your answers, and sorry once more for that stupid question :(

Clément.

15 Aug
5 months ago

Neewd started a new conversation Do We Must Use A Paid Mailing Service ?

Hello,

I am currently implementing some features who needs to mail the user.

From the docs I have seen a lot about mailgun, sparkpost, mantrill and some other.

But nobody talked about own implementation ? It’s impossible to implement our own mail function nowadays ?

I know those services can track my needs etc etc but atm I do not matter or such feature and their free pricing plans seems quite low for my mid term needs.

If anyone got that question I would be happy to listen the answers

Clement

23 Jun
6 months ago

Neewd started a new conversation Redirect With Messages On Session Don't Work

Hello,

For the context, I have a route who activate the account when the user clicks on a button on his email. At the end of my controller I would like to redirect into my '/' route with a little session flash message to indicate at the user that his account has been activated.

I took the documentation from Laravel with this little piece of code :

return redirect('dashboard')->with('status', 'Profile updated!');

I adapt this example to my needs like this :

return redirect('/')->with('message', 'You're account has been activated!');

The only part who changed in comparison of the documentation example is that I use Vue components as front-end so when my component mount, I check if the session exists, but it always returns me false :(

Does anyone have this kind of example with Vue who actually works ?

Thank you for your kind help and your time,

15 Jun
7 months ago

Neewd left a reply on Laravel + Vue : Routes On Web.php / Api.php

If I want to use the CreateFreshApiToken, it comes from Passport, how I can use this without Passport ? :o

I have another question about the consumption of my API through my javascript framework. I put my API routes in my 'api.php', and my web routes - and Auth::routes in my web.php. The CreateFreshApiToken middleware will be add to the web groups middleware, so when I'll make a login, the reply will contains a token, and when I will make an axios call to my API, I have to send the X-CSRF-TOKEN and the width in the headers, and all gonna be right, right ?

Neewd left a reply on Laravel + Vue : Routes On Web.php / Api.php

Hello,

Thanks you both for your answers. My need is to call my API in the front-end via Vue.js, if I put my ::resource routes on the api.php, and if I use the CreateFreshApiToken for my API auth, that fills my need no ? https://laravel.com/docs/5.6/passport#consuming-your-api-with-javascript

14 Jun
7 months ago

Neewd started a new conversation Laravel + Vue : Routes On Web.php / Api.php

Hello guys,

I am quite a new guy on Laravel and I have started working on a project, and I would like get some advice about the good architecture to pick.

I decided to manage my front with Vue and my backend with Laravel.

What I have started to do is to capture the routes through Laravel and sent it to my Vue routes to determines which components to load etc. And I was thinking to make "api" calls though axios into my Vue.components to retrieve the data from my controller in order to display them into my view.

That's still a "web" logic.

But I am also thinking to the future API I will provide.

So what is the best option to take ?

Put some Route::resource('model', 'Controller') into the web.php file, then call those routes in my Vue.components, and put the Route::resource('model','Controller') into my api.php file ?

Thank you for your answer I don't know if I am going the right way or not.

Clément.