KNietzsche

Web Artisan at Colmar

Experience

47,630

9 Best Reply Awards

  • Member Since 7 Months Ago
  • 392 Lessons Completed
  • 117 Favorites

18th October, 2017

KNietzsche left a reply on Using Vue-i18n Single File Components With Laravel(-mix) • 1 day ago

Will check your link in the next days, could be interesting, now I understand what you wanted to do with your additional explanations. Nice !

KNietzsche left a reply on Vue Form Not Sending Data In Request • 2 days ago

Also you could use syntax like following if you want to send your form

var self = this;
let params = Object.assign({}, self.form);
axios.post('/user/login', params)
.then(function(){

below an example of route without a controller to catch the request data

Route::post('user/login', function(Request $request){
        return Contact::create(['email' => $request->input('email')]);
});

etc, hope that helps

KNietzsche left a reply on Vue Form Not Sending Data In Request • 2 days ago

How did you declare axios ? I don't understand your $backend with what you described

in my app.js I have

let axios = require('axios');
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

const app = new Vue({
    el: '#app',
    translations
});

I used for example in my vue component

 import axios from 'axios'

  export default {
....
 postAnswer() { 
          axios.post('/validate_answer',
            {  
              question_id: this.question.id
             } )
          .then((response) =>
          {
                // alert('POSTED');
                console.log('answer posted'); 
                ...
          })
           .catch(function (error) {
                console.log(error);
              }); 
        },

and in my controller

  public function validateAnswer(Request $request)
    {
  $answer = new Answer;
 $answer->question_id = $request->question_id;
...
      return response('answer saved');
}

and it's running very well for me

KNietzsche left a reply on Using Vue-i18n Single File Components With Laravel(-mix) • 2 days ago

I'm not sure about what you try to do....but here is what I did in order to use translations with i18n

I followed installation process from installation vue-18n and I have the followings

package.json

"dependencies": { 
        "vue-i18n": "^7.3.0"
    }

app.js

require('./bootstrap');
// window.Vue = require('vue');
import Vue from 'vue';
import i18n from 'vue-i18n'

import { translations } from './translations.js'
Vue.use(i18n, translations);
....
const app = new Vue({
    el: '#app',
    translations
});

here is a translations.js file in same folder as app.js for my example

export const translations = {
  'en': {
    'Hello world': 'Hola Mundo',
    'Next': 'Next',
    'Result': 'Result' 
  },
  'fr': { 
    'Hello world': 'Bonjour le monde',
    'Next': 'suivante',
    'Result': 'Résultat'   
  }
}

and here in a component how I get translation Situation.vue

  <button @click="postAnswer">{{ $t('Result', { locale: language  }) }}</button>

Finally set your language in the controller for example, before to call the view containing your vue component

  app()->setLocale( $language->code );

I didn't change any other file, just followed the installation process described in the file coming from the same site you mentioned, and it runs perfectly, after npm run watch

Hop that can help you.

15th October, 2017

KNietzsche left a reply on Windows10, Xampp & Phantomjs • 4 days ago

Thanks for the link, I will read it and check it this week.

KNietzsche left a reply on Best Way To Become A 'web Programmer' • 5 days ago

Good job @kognitif !! This is the Kaïzen theory of the little steps... If you want to go for 1 miles, you first need to do the 1st step, then another and another ! step by step...don't look behind, go forward...and one day, you reach your destination ! There you can say....wow ! I did it !

KNietzsche left a reply on How To Get Answers To The Questions ? • 5 days ago

Facts : For a stupid question, a lot of answers, and even some people went only to blame...and for some real questions, they don't even give a look, very interesting to study !

@ChristophHarms you were right but wrong, because you continued to answer after finally, lol @Ricardo An experience of 1 year repeated 30 times does not mean you have 30 years of experience @Devon yes, I will try to take your advices into account, but sometimes questions seem to be so clear in our mind

So I apologize if I hurted some people who were sincere...Error is human ! But some will recognize themselves with what I mentioned..

Thanks for your participation, see you on some other laravel technical battles. The experience is finished...Let's focus on something else now....

14th October, 2017

KNietzsche left a reply on How To Get Answers To The Questions ? • 6 days ago

I'm really impressed by the quality of your answers, I don't believe in gods ! ! Almost exactly what I expected when I asked this ironic question ! A points hunter trap ! 1 million points and not aware of what turbolinks, yields, includes are ! Amazing ! Simple question...how to generate a chart and send it by mail....share your knowledge then, that should take 30 seconds to write a link or give an idea ! Instead, blablabla bla bla community share d*ck bla bla bla....Show in a practical case how you do instead of copying preaches ! If I ask a question, it's because I have tried, or because I don't find any good links....not because I want you to write the code for me ! I usually don't ask for that ! If I know an answer when I read a question and if I have time, even if it takes me 1h or more to create an example for my answer, I do it, I dit it already...and a simple thanks is ok, I don't need points like some people apparently here, I don't need to be the WorldChampion of Laracasts...I just want to progress

13th October, 2017

KNietzsche started a new conversation How To Get Answers To The Questions ? • 1 week ago

10 questions, 3 with some kind of answers....what's the problem ? It's like every of my question is the evil case that the world discovers with my question...

KNietzsche started a new conversation Turbolinks Errors With Multiple Yields/includes • 1 week ago

Hello, I have added turbolinks to a project, and some very strange things have happened.... Project uses Jquery and BS4, the template has several yields and include directives....When I check in the browser, after several clicks...menu is sometimes disappearing, sometimes, written after the first yield content, sometimes, the menu is completely hidden... So I would like to know if you already got some of these symptoms...how to solve them....If you have any idea

11th October, 2017

KNietzsche left a reply on Site Review • 1 week ago

If you were registered as a member since .... and got some points...I would have checked...but I agree with @jlrdw , so I will not help for now

10th October, 2017

KNietzsche left a reply on How To Generate Chart And Send It With Email ? • 1 week ago

Question is still open

KNietzsche left a reply on Docker Series • 1 week ago

+1

9th October, 2017

KNietzsche started a new conversation Windows10, Xampp & Phantomjs • 1 week ago

In which directory should I put phantom.exe if I have a tree like that ?

d:\xampp
     htdocs
        myProjectLaravel

Also, how to configure correctly phantomjs... I try to run webshot but I have some errors now.. Error when executing PhantomJs procedure - File does not exist or is not executable: bin/phantomjs Have read and watched a lot of things, but was not able to run an example yet.... thanks for your help

KNietzsche left a reply on How To Generate Chart And Send It With Email ? • 1 week ago

Following installation process, just tested you 1st link but always Page load timeout....

KNietzsche left a reply on How To Generate Chart And Send It With Email ? • 1 week ago

@alex_storm > If you can create a diagram, why can not you create an image of this diagram?

Exactly what I'm asking ! How can we do that ? How can you save a chart generated with chart.js like in Jeffrey's video as a file so I can send the image later ? Personnally I prefer d3.js or echarts, so I would like to have a general way of doing that whatever the library is... If you have links, ideas...you're welcome !

KNietzsche left a reply on How To Generate Chart And Send It With Email ? • 1 week ago

Nobody generates charts and send them by mail with Laravel ? Funny

KNietzsche started a new conversation Errors Laradock • 1 week ago

Trying to play with Docker and Laradock on CENTOS 7.4.1...but I get these errors

WARNING: The PMA_USER variable is not set. Defaulting to a blank string.
WARNING: The PMA_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PMA_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PMA_DB_ENGINE variable is not set. Defaulting to a blank string.
WARNING: The PMA_PORT variable is not set. Defaulting to a blank string.
etc
WARNING: The PHP_VERSION variable is not set. Defaulting to a blank string.
WARNING: The MONGODB_PORT variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_DB variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_USER variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_PORT variable is not set. Defaulting to a blank string.
WARNING: The KIBANA_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_USER variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
etc
WARNING: The APACHE_PHP_UPSTREAM_PORT variable is not set. Defaulting to a blank string.
WARNING: The APACHE_PHP_UPSTREAM_TIMEOUT variable is not set. Defaulting to a blank string.
etc
etc 
WARNING: The WORKSPACE_NODE_VERSION variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_YARN_VERSION variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_CLIENT_ID variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_CLIENT_TOKEN variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_SSH_PORT variable is not set. Defaulting to a blank string.
WARNING: The BEANSTALKD_HOST_PORT variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.proxy.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy2.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.memcached.ports is invalid: Invalid port ":11211", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
etc
services.caddy.ports is invalid: Invalid port ":443", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.nginx.ports is invalid: Invalid port ":443", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.selenium.ports is invalid: Invalid port ":4444", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.jenkins.ports is invalid: Invalid port ":50000", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.postgres.ports is invalid: Invalid port ":5432", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.postgres-postgis.ports is invalid: Invalid port ":5432", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.kibana.ports is invalid: Invalid port ":5601", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.rabbitmq.ports is invalid: Invalid port ":5672", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.laravel-echo-server.ports is invalid: Invalid port ":6001", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.apache2.ports is invalid: Invalid port ":80", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
etc
services.elasticsearch.ports is invalid: Invalid port ":9200", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.elasticsearch.ports is invalid: Invalid port ":9300", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]

Any idea of how to correct that ?

8th October, 2017

KNietzsche started a new conversation How To Generate Chart And Send It With Email • 1 week ago

I followed lessons to send email and to generate charts (pies, bars)...they both run well alone. But when I try to send a mail with a chart... it fails.. What are the solutions to achieve such a case ? Server side rendering ? calling a nodejs or express server or something else url with parameters where the chart will be generated and will send an url to the image ? I would like to understand and find what the best solution is. So if you have links, tutos, videos that could help me...I believe I must not be the only one... I would apreciate your help..looking for something easy, not too expensive (if not free)

30th September, 2017

KNietzsche left a reply on Can You Do Everything In Vue.js That You Can In JQuery? • 2 weeks ago

Vue is a progressive framework....you can start with 1 component and then add another and another...Once you understand, you will decide for each app if you need vue-router vuex vue-i18n etc You just need a little time and practice to understand, and Jeff has made some very nice videos here with Vue, VueX...It's easy to understand, and you don't need to use jquery..but you can use some if you need or want, or import libraries like moment.js etc. You can build frontend without laravel, but for backend you still need some apis, databases, jobs, mails etc...so laravel is a good friend for vue ! Just think, you need to learn, so don't hurry....and you will see the magic of vue !

KNietzsche left a reply on Parse Error In Helpers.php After Creating New Project • 2 weeks ago

ok...I just removed php and reinstalled my 7.0 version....restarded httpd (centOS 7) and it seems running well now

KNietzsche left a reply on Parse Error In Helpers.php After Creating New Project • 2 weeks ago

Just installed a new app on a vestacp ...all was running then I run an artisan command to create a model and then, got the same error. php -v shows PHP 7.0.24 (cli) (built: Sep 26 2017 16:44:55) ( NTS ) so what is the solution to solve this issue ?

24th September, 2017

KNietzsche left a reply on Axios Wrong Response On Post • 3 weeks ago

Yes, that's why I try to update my answers to my questions ! What a lot of people don't do ! I solved my problem by myself having spent 2 days...and if I count the number of answers I got, I doubt that interests somebody else. When people don't play the game, I do the same, but I asked several questions and got not even a single answer, so, sorry to react like this..that's why, I said, if one day, I see a similar question, I will share my knowledge to help if the one who asked did not register 1 hour ago...of course...So I think I'm very polite in fact ! ;o)

23rd September, 2017

KNietzsche left a reply on Axios Wrong Response On Post • 3 weeks ago

Just wanted to add that there were additional reasons to explain why the responses were not there. But now, everything is ok... Maybe one day I will answer to a similar question with further details !

22nd September, 2017

KNietzsche left a reply on Axios Wrong Response On Post • 4 weeks ago

ok after I updated npm to 5.4.2 and rebooted my pc, everything is running perfectly now. Maybe just rebooting was enough, but I don't want to retry, lost enough time !

KNietzsche left a reply on Axios Wrong Response On Post • 4 weeks ago

yes, but I can't see any response ...only failed to load response data in preview and response tabs...and if I comment $myModelVariable->save(); statement, all is ok and got my status 200 response.

KNietzsche started a new conversation Axios Wrong Response On Post • 4 weeks ago

I noticed strange things when I use Axios with post request, when in the controller I send a return response(['status' => 'registered'], 200); before I save my model, all is ok When I save my model with data, the database is updated with the new record, however when I send the same return response(['status' => 'registered'], 200); I can see the request in RED in chrome Also I notice than sometimes, all is ok, and sometimes, the url is changed example: http://localhost/project/public/ and redirects to http://localhost/project/public/?email=test%40test.com after the Ajax Post request was called

Do you have some ideas to let me find what's wrong ? Did you already got such of issues ? Thank for your answers.

18th September, 2017

KNietzsche left a reply on Alternative Model Boot Creating For A Field • 1 month ago

thks already for your answers, not sure it is the best answer now, but for sure I will try in the next days. Thumbs up to both of you for now. Thanks. If there are other ideas, they are welcome too !

KNietzsche started a new conversation Alternative Model Boot Creating For A Field • 1 month ago

currently I have created a boot function in my model to update a field at creation time. something like this, and it runs well

class Mymodel extends Model
{
public static function boot(){
         static::creating(function ($model) {
         $model->myField = MyTrait::myMethodForMyField();
        }); 

But I would like to use this field in all of my tables....so, is there an alternative to globally fill a hidden field in all of my tables different from changing all of my models with all the same code ? Even with a trait, it's a lot of work...If you have some ideas, thanks !

16th September, 2017

KNietzsche left a reply on Is 2 Weeks For Learning Laravel Fast? • 1 month ago

2 weeks , in your dreams ! you can get an overview, understand globally how it works....but if you begin to practice you have to review again what you forget because that was too fast...and go deeper into details....and then to go to nodes, git, composer, vuejs, vuex, acl, translations, providers, broadcasting, sockets, mails, queues, redis, VPS config etc etc ....tons of things...expect 6 months to begin to swim comfortably (and not 5min a days but 10 hours), after that, it begins to be really fun to work with Laravel...and a year at least for more !

13th September, 2017

KNietzsche left a reply on Vue JS Route Posting To A Blade Page • 1 month ago

did almost the same passing the route url into a prop ... you can also use javascript functions like window.location.href = ... or window.location.reload();

KNietzsche started a new conversation Lot Of Problems With Npm 5.4.1 • 1 month ago

Do you have problems as well with npm 5.4.1 ? got so many errors since I updated it this week, that I was forced to uninstall npm and reinstall nodes and npm 5.3.0 on windows 10 to correct all after I read tons of posts related to the same problems about EPERM on several forums. That was a nighmare, even if I was able to run yarn....

12th September, 2017

KNietzsche left a reply on Attempting To Load A Vue Component And Populate It With Ajax Json Content • 1 month ago

using axios I usually have something like .then(response => this.count = response.data);

so I believe you should begin to change

success:function(msg){
                    app.data = JSON.parse(msg);
           ---> to         this.features = ....
                    }

KNietzsche left a reply on Photo Upload Preview • 1 month ago

@ohffs just need it now, and your solution is still working very well !

9th September, 2017

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

if you used Vuex, you could dispatch automatically once your action was commited from your store to your component...for example each time after you added something in your database... Otherwise you need something like events and broadcasting to accomplish what you want (check pusher, redis, ...)

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

@david001 one step after another ! FIrst, your counter was not running because you did forget some things....now, it's working, if you want to refresh automatically ...check the setTimeout function and add it in your method : something like that...

setTimeout(this.yourMethodNameThatYouWantToCallAfterEach1Sec, 1000);

There are some other useful links and examples in the forum ! You should be able to get it running !

8th September, 2017

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

ok just tested with your code...add this.count = response.data...

       .then((response)=>{        
          this.count = response.data
        return(response.data)

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

as it is a GET you should be able to try your api using your browser /events/participant/count/1 and the total should be displayed

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

also notice that if you work locally on windows, maybe without virtual host, you should add something on the url... For example /yourappdir/public/events/participant/count/ instead of events/participant/count/ Use Devtools to inspect the url in chrome for example

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

how did you pass your this.eventId in mounted ? I cannot see any props or data containing the value... something like that

  export default {
  ...
    props: [ 'eventId' ]

and in your blade template

<YOUR_VUE_COMPONENT_NAME
 eventid= {{ $yourParticipantVariable.eventId }}
>
```                ],

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

how did you define your route ?

KNietzsche left a reply on Update Total Count Laravel And Vue Js • 1 month ago

Your route is missing in your example...but ok... If you use axios (ajax) you would like to return a response from your method countParticipant($id) something like this

public function countParticipant($id)
    {
    $count= Participant::where('event_id',$id)->count();
         return response()->json($count);
    }

5th September, 2017

KNietzsche started a new conversation Vuex : Error ...mapActions ...mapGetters • 1 month ago

I have an error

error  in ./resources/assets/js/components/Searchbar.vue                                                                                                                                                                                                                     Syntax Error: Unexpected token (102:8) 

from this code

 methods: {
             
            ...mapActions(['myAction']),

I've got the same error with mapGetters and corrected it like below

 computed: {
            // ...mapGetters(['todos']),
            todos () {
                  return this.$store.getters.todos
            }
        },

but I would like to use the other syntax

I don't know how to correct it, I have installed babel but still the error is there...I must miss something... Do you have an idea ? Thanks for your help.

26th August, 2017

KNietzsche left a reply on How To Write The Below Query In Laravel • 1 month ago

not sure to understand clearly your question... you can create relations in your models (post belongsTo a user ..and a user hasMany posts) then update all the statuses for the posts for a user...like I said with Eloquent, Query...or with basic loops..but..this way of updating a login_status for each post seems a little strange and curious to me, but good luck !

KNietzsche left a reply on How To Write The Below Query In Laravel • 1 month ago

check DB::statement DB::raw DB::update like in this laravel database doc...but I would prefer to use model and eloquent syntax.

KNietzsche started a new conversation Keycloak • 1 month ago

Any experience using Laravel with Keycloak ? (tutos, links) Idea is to use Keycloak to replace traditionnal user management...does that have a sense ? Is that a bad idea ? good idea ?

18th August, 2017

KNietzsche left a reply on Join Two Tables • 2 months ago

simply create a hasMany (ex: in your Address model) and belongsTo (ex: in your LinkedAddress model) (or change to the corresponding relationship according to your case) use Eloquent with query builder to retrieve the data with your additional condition (code != 5). There are several examples in Jeff's videos Also check Laravel relations.

15th August, 2017

KNietzsche left a reply on How To Add Font-awesome To Laravel-Mix • 2 months ago

@frizbee simply remove the right parenthesis at the end of the url ) in the browser and you can access to the post.

13th August, 2017

KNietzsche left a reply on How To Get Privious Image In Choose File In Update Function? • 2 months ago

  1. check if your image file exists in the folder where it should be
  2. check the url of your image when you try to show it (and correct the filename if necessary) or You could use [acessors](// https://laravel.com/docs/5.4/eloquent-mutators#accessors-and-mutators) to update automatically the filename
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.