How to place the ~/.composer/vendor/bin directory in your PATH?

To put this folder on the PATH environment variable type export PATH=”$PATH:$HOME/.composer/vendor/bin” This appends the folder to your existing PATH, however, it is only active for your current terminal session. If you want it to be automatically set, it depends on the shell you are using. For bash, you can append this line to $HOME/.bashrc … Read more

Laravel 5.6 – Passport JWT httponly cookie SPA authentication for self consuming API?

I’ll try to answer this in a generic way so that the answer is applicable across frameworks, implementations and languages because the answers to all the questions can be derived from the general protocol or algorithm specifications. Which OAuth 2.0 grant type should I use? This is the first thing to be decided. When it … Read more

Migration: Cannot add foreign key constraint

Add it in two steps, and it’s good to make it unsigned too: public function up() { Schema::create(‘priorities’, function($table) { $table->increments(‘id’, true); $table->integer(‘user_id’)->unsigned(); $table->string(‘priority_name’); $table->smallInteger(‘rank’); $table->text(‘class’); $table->timestamps(‘timecreated’); }); Schema::table(‘priorities’, function($table) { $table->foreign(‘user_id’)->references(‘id’)->on(‘users’); }); }

Laravel – Eloquent “Has”, “With”, “WhereHas” – What do they mean?

With with() is for eager loading. That basically means, along the main model, Laravel will preload the relationship(s) you specify. This is especially helpful if you have a collection of models and you want to load a relation for all of them. Because with eager loading you run only one additional DB query instead of … Read more

Vue js in laravel [closed]

you just need to write this.tweets also you need to change your callback function to arrow function to allow you to access your state like this async recupera_post(){ await axios.get(‘api/schedulepost’) .then((response) => { console.log(response.data) this.tweets = response.data }) } }