keevitaja

keevitaja

at unemployed

Tallinn, Estonia

Member Since 5 Years Ago

Experience Points 56,310
Experience
Level
Lessons Completed 168
Lessons
Completed
Best Reply Awards 21
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.

22 Oct
1 month ago

keevitaja started a new conversation SAMI Documentation Generator Alternatives

YO!

Not too long time ago SAMI, https://github.com/FriendsOfPHP/Sami, was archieved and thus makes it difficult to use.

Does anyone have some information on this subject. Why and if there will be a fork with new maintainer?

Also if you can please suggest some alternatives which work well with lates PHP versions.

PS Laravel uses SAMI too https://laravel.com/api/5.7/

23 Apr
7 months ago

keevitaja started a new conversation How To Ignore Specific Query Parameter With Varnish Cache?

I need to cache this request with varnish, but i need to ignore the last query parameter _=1524469655019.

I am not sure how varnish internally works, but i suppose it makes the cache uid key from the url requested. So in my case it would need it only to create the uid key from this url

Doing something like req.url ~ "^/swatches/(.*)$" would not work as varnish would still use the entire url for cache uid.

19 Mar
8 months ago

keevitaja started a new conversation Test How Does A Website Handle Load

Hello!

Can anyone recomment a service (paid is fine!), where i can test how does a webpage handle load. The service should be able to mock n+1 users requesting a page. Also requests must run js for any ajax request.

Not laravel spedific at all!

21 Jan
10 months ago

keevitaja left a reply on Which Linux Distro Should I Use

@defji lol, check the screenshot again and read!

xfce, arc gtk theme, paper icons

11 Nov
1 year ago

keevitaja left a reply on Vue And Laravel Named Routes

Use https://github.com/tightenco/ziggy to get the route() javascript helper.

keevitaja left a reply on Multilingual Apps In Laravel

Hi guys, i continue my spam.

It turned out, that 2 years ago i had no clue what i was doing. I recently updated the Linguist (https://github.com/keevitaja/linguist) package. It got so much easier to use.

Most of the Laravel goodies work out of the box. You can use route() or url() and also redirections pick up the correct locale. by default.

For a bonus this package also works well with https://github.com/tightenco/ziggy .

17 Oct
1 year ago

keevitaja left a reply on Downgrading PHP 7.1 To 7.0

I have not fixed the issue. I have bunch of stuff running there and i do not want to mess everything up.

But another question is, when you create a new site with forge, will it be 7.0 or 7.1?

13 Oct
1 year ago

keevitaja left a reply on Laravel Certification. 2017!

Not the employers and not the clients will ever care about this.

A certificate worth depends on the quality of the program and issuer.

When ever you can take the "test" online, the certificate becomes worthless. Those online tests can never make sure, who actually gives the answers.

So this project is 100% another way to make money!

06 Oct
1 year ago

keevitaja started a new conversation Downgrading PHP 7.1 To 7.0

Hello!

Forge does not provide any way to downgrade PHP version.

Has any of you done that before? How to do it correctly so all new sites would be 7.0

07 Sep
1 year ago

keevitaja started a new conversation Odoo Setup

Hello!

I am trying to install Odoo 9 on a forge provisioned subdomain with no luck.

Has any of you done this? Service is installed and running. Just need some help with setting it up!

Thank you.

06 Aug
1 year ago

keevitaja left a reply on Laravel 5.5 And Dispatch

All good.

Dispatcher->dispatchNow() is the answer

keevitaja started a new conversation Laravel 5.5 And Dispatch

Hello!

5.5 dispatch() helper returns PendingDispatch class instead of the jobs handle methods return value. Is it possible to get the handle return value like it was implemented in 5.4?

01 Aug
1 year ago

keevitaja started a new conversation Mysql: Multiple Tables Join

Hello!

I have 2 tables:

entities:

id

statuses:

id
entity_id
status

Each entity can have many statuses and i need to select only the entities that have 'paid' status and do not have 'cancel' status. How do i do a proper join for that?

Not using eloquent, but raw queries.

06 May
1 year ago

keevitaja left a reply on Reloading A Dynamic VueJs Component

<component :is="view" :key="key"></component> does the trick

keevitaja started a new conversation Reloading A Dynamic VueJs Component

anyone knows how to reload a #vuejs dynamic component?

<component :is="view"></component>

reassigning does not do the trick!

16 Apr
1 year ago

keevitaja left a reply on Localization Tips For Project With Dynamic Content.

@oten @dashty

Check out these packages:

https://github.com/keevitaja/linguist https://github.com/dimsav/laravel-translatable

The first package is for the routing. All it does is it removes the locale slug from the REQUEST_URI and defines locale as a constant which will be used in the configuration file. It is so simple, that you can actually copy the code from

https://github.com/keevitaja/linguist/blob/master/src/Http/Kernel.php#L31

and use it in your index.php or just paste the kernel file.

The second package gives you the eloquent support. Through you have to design your app from ground to support the laravel translatable package.

07 Feb
1 year ago

keevitaja left a reply on Allow Remote Mysql Access

nono, i need to change firewall settings

keevitaja started a new conversation Allow Remote Mysql Access

Hello!

How do i allow remote mysql access on a forge provisioned server?

PS! I know that is not secure!

08 Jan
1 year ago

keevitaja started a new conversation Getting Ajax Call Db Queries Into Laravel Debubar

Hello!

Is it possible to get Laravel debugbar display also db queries that are executed by ajax calls?

keevitaja started a new conversation Change The Route Variable Name

Hello!

Is it possible to change the route variable name?

Route::resource('invite', 'Account\InviteController') will create account/invite/{invite} but i need it to be account/invite/{account}

03 Jan
1 year ago

keevitaja left a reply on Change The Url Of The Password Reset Link Send By Broker

This has nothing to do with the reset link send by email to the user. I need to change url in the mail.

keevitaja started a new conversation Change The Url Of The Password Reset Link Send By Broker

Hello!

How can i change the url of the password reset link sent out by password broker?

The default is password/reset/<token> but i need something else.

30 Dec
1 year ago

keevitaja left a reply on Laravel 5.4 And Axios

does axios attach ajax headers by default?

20 Dec
1 year ago

keevitaja started a new conversation Render Ajax Loaded Vue Components?

Hello!

I have situation, where my-form components gets some html via ajax get call, which has another vue component in it, and i pass it to dom. But this is not working, as the component from the ajax will not be rendred once injected into the dom.

Is there a simple workaround for this?

17 Dec
1 year ago

keevitaja started a new conversation Communications Between Components

<my-parent>
    <my-child></my-child>
    <my-child></my-child>
    <my-child></my-child>

Is it possible to "register" these child components in parent component so i could manipulated children properties?

I tried with mounted() to add the child instance to parent property, but it will not be reactive.

09 Dec
2 years ago

keevitaja started a new conversation How To Get Vue Components Actual Height

Hello!

This is probably more general javascript+css question. But maybe vue has some nice workaround.

I have a tabs component with inline template. And i need to get the actual height of the component. Is it doable at all?

https://jsfiddle.net/3tao4rsf/

04 Dec
2 years ago

keevitaja left a reply on Disable ES5 Transpiler In Elixir Webpack

scripts will only concatenate. It does not bundle dependencies.

03 Dec
2 years ago

keevitaja started a new conversation Disable ES5 Transpiler In Elixir Webpack

Hello!

Is it possible to disable transpiler in Elixir? Like it would still have to bundle, but not transpile.

I am building project where only latest firefox and chrome are targeted. Do i need to transpile the ES6 syntax to ES5 at all? Project is using other technologies as well that are not supported by IE.

28 Nov
2 years ago

keevitaja started a new conversation Elixir Cannot Transpile ES6? Seriously?

Hello!

I might be wrong... and i hope i am. But elixir does not know how to transpile for of loops.

Some suggest it has to do something with using nodes buble instead of babel.

Any way to fix this issue?

keevitaja left a reply on Laravel Elixir Error When Using For ... Of

Any clue how to use babel instead of this buble?

26 Nov
2 years ago

keevitaja started a new conversation How To Bundle Font Awesome With Elixir And Webpack

Hello!

Is it possible to bundle Font Awesome, and other dependencies, into the main.js file?

If yes, then how?

24 Nov
2 years ago

keevitaja left a reply on Passing Variable Data From Dom Content To Vue Data Object

Thanx. I considered this approach too, but for me it seemed like a minor hassle.

I am almost certain, i got it working with html data attribute

<span v-for="item in repo.test" data-repo='{"test": {"1": "one", "2": "two"}}'>
    {{ item }}    
</span>

and in my js file i do

let repo = {}

for (let element of document.querySelectorAll('[data-repo]')) {
    let data = JSON.parse(element.getAttribute('data-repo'))

    for (let i in data) repo[i] = data[i]
}

const App = new Vue({
    el: '#vue-app',
    data: {
        repo: repo
    },

The idea is, i can inject data from anywhere. If anyone has tried this approach and in the end ran into some trouble, please let me know.

keevitaja started a new conversation Passing Variable Data From Dom Content To Vue Data Object

Hello!

What is the best option to pass data to vue object?

<span v-for="item in [1,2,3,4,5]">

This array is created by php. I would need later to modify the array. Like add/remove items.

How should tackle this?

31 Oct
2 years ago

keevitaja left a reply on DropZone Will Not Display Upload Area

csrf is not the problem. I just cannot display the dropzone "box"

keevitaja left a reply on DropZone Will Not Display Upload Area

Nope, these will not resolve this

keevitaja started a new conversation DropZone Will Not Display Upload Area

Hello!

I cannot get Dropzone working and i am pretty much sure it is just me. I used the dropzone npm package and installed it.

In app.js i have

const Dropzone = require('dropzone')

const AdvertUpload = new Dropzone('div#dropzone', { url: '/file/post'})

In view file <div id="dropzone"></div> and no js errors are displayed.

If i remove the id from div, i get dropzone error?

What the heck am i doing wrong?

16 Oct
2 years ago

keevitaja left a reply on Which Linux Distro Should I Use

I have used Linux, and only Linux, about 20 years... This my recommendation:

Stay away from the Ubuntu family if you want a good Linux desktop.

For all Ubuntu users, i am sorry. If it works for you, keep using it. I have no desire to go into "best linux distro" argument. These are just my personal opinions. And i have also used Ubuntu myself for many years, so i know thing or two.

Ubuntu package management is built in away, that forbids you to use newer software. If Ubuntu has some version Desktop environment in their repositories, then you're pretty much stuck with it. Like for the example if they have older Gnome which comes older GTK, then there is a possibility you cannot use some newer software.

Also Ubuntu's private package manager PPA is piece of crap. You must install a repository for each application and you're still stuck with the libraries that come with Ubuntu installation.

While Ubuntu is a free (as in free beer) software, it is not free (as in free speech). There have been multiple documented cases, where Ubuntu installations have contained shady spyware.

Ubuntu is slow. For some weird reason, there are so many services enabled by default. Perhaps it is not true for some Ubuntu based distros (i just do not know), but this is the case for the official releases. From my personal experience: after i closed services i did not need and uninstalled some packages, my cold-boot memory usage dropped from 1.2gig to 700mb.

While there are some nice looking Ubuntu based distros out there, most of them are not usable for work. They are not 100% stable and bugfixes may take weeks if not month. For work you need a system that is rock solid!

I personally use Manjaro Linux, which is an Arch based distro. And Arch comes with official Pacman package manager and AUR for user repositories. If there is some software available for Linux, and it is open-source, then 99,99% it is available on AUR.

Manjaro as as easy to install and use as Ubuntu. So no worries in that department.

So i recommend you to try out Manjaro. I am not saying, that it is THE best distro out there. Just give it a try!

12 Oct
2 years ago

keevitaja left a reply on Vue Powered Collapsable Sidebar Menu

Huh? No one has never done a collapsing sidebar using Vue?

11 Oct
2 years ago

keevitaja started a new conversation Vue Powered Collapsable Sidebar Menu

Hello!

What is the logic behind Vue handling sidebar menu?

http://www.designerslib.com/wp-content/uploads/2015/11/responsive-navigation-menu.jpg

With jQuery and other legacy frameworks i would first create the html using php and then start modifying the dom.

With Vue should i first create javascript object and let Vue create the menu? And then i would just modify this object and Vue would take care of everything else?

08 Oct
2 years ago

keevitaja started a new conversation Bundling Bower Package Css Files With Relative Urls Inside Them

Hello! I am trying to figure figure out, how to bundle css from bower vendor packages. Currently i am loading different css files:

<link rel="stylesheet" href="{{ asset('bower/AdminLTE/bootstrap/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('bower/font-awesome/css/font-awesome.min.css') }}">
<link rel="stylesheet" href="{{ asset('bower/Ionicons/css/ionicons.min.css') }}">
<link rel="stylesheet" href="{{ asset('bower/AdminLTE/dist/css/AdminLTE.min.css') }}">
<link rel="stylesheet" href="{{ asset('bower/AdminLTE/dist/css/skins/skin-blue.min.css') }}">

And some of these files have relative urls pointing to assets inside them. For the example in AdminLTE we find:

.layout-boxed {
  background: url('../img/boxed-bg.jpg') repeat fixed;
}

So if i use elixir and bundle all these files to bundle.css or something, all these pointers to different assets would be broken.

Is there a way to solve this issue?

03 Oct
2 years ago

keevitaja left a reply on Accessing Global Variables In Vue Components

wat? this is working...

keevitaja left a reply on Accessing Global Variables In Vue Components

I am building a modal window component for the AdminLTE which asks for deletion confirmation and then sends delete request dynamically. This is what i have:

app.js

require('./bootstrap');

const app = new Vue({
    el: 'body',
    components: {
        destroy: require('./components/DestroyModal.vue')
    }
});

DestroyModal.vue

<template>
    <button type="button" class="btn btn-danger pull-right" data-toggle="modal" data-target="#deleteConfirmationModal">
        {{ button }}
    </button>

    <div class="modal modal-danger fade" id="deleteConfirmationModal" tabindex="-1" role="dialog" aria-labelledby="deleteConfirmationModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
                    <h4 class="modal-title" id="deleteConfirmationModalLabel">{{ question }}</h4>
                </div>
                <div class="modal-body">
                    {{ text }}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline" data-dismiss="modal">{{ cancel }}</button>
                    <button type="button" class="btn btn-outline" v-on:click="destroy(url)">{{ button }}</button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            button: { default: 'Delete' },
            question: { default: 'Are you sure?' },
            text: { default: 'Deleting this resource cannot be undone!' },
            cancel: { default: 'Cancel' },
            url: {},
            csrf: {}
        },
        methods: {
            destroy: (url)=> {
                let element = document.querySelector('body');
                
                element.insertAdjacentHTML('beforeend', `
                    <form id="delete-request" action="${url}" method="post">
                        <input type="hidden" name="_token" value="${document.helpers.csrf}">
                        <input type="hidden" name="_method" value="DELETE">
                    </form>
                `);
                
                document.getElementById('delete-request').submit();
            }
        }
    }
</script>

and in blade view file i do

<destroy url="{{ route('admin.user.destroy', $user->id) }}"></destroy>

This is all fine and working. But lets say i need to generata a unique string for the modals ID. There are plenty of functions prewritten, but i do want to share this function with all my vue components. How do i do that?

document.somefunc = () {} does not look OK

keevitaja left a reply on Accessing Global Variables In Vue Components

But how do i share different things between components? Like custom helper functions...

Pushing them all to window or document object seems silly...

keevitaja started a new conversation Accessing Global Variables In Vue Components

Hello!

I have declared some javascript variables in blade view files like this:

<script>
    var helpers = { 'csrf': 'dsgsdfjsdlkjsdlkfjskd'};
</script>

And i need to use them in vue components:

<template>
    <form id="delete-request" action="{{ url }}" method="post">
        <input type="hidden" name="_token" value="{{ csrf }}">
        <input type="hidden" name="_method" value="DELETE">
    </form>
</template>

<script>
    export default {
        props: ['url'],
        data: ()=> {
            return {
                csrf: helpers.csrf
            }
        }
    }
</script>

How can i do this? The example above is not working....

02 Oct
2 years ago

keevitaja started a new conversation Handling Dynamic Modal Windows With Vue

Hello!

What would be the best way to inject modal windows described by vue components into DOM by clicking an html element?

20 Sep
2 years ago

keevitaja started a new conversation Modifiying Existing Table With Laravel Migrations Error

Hello!

I took over a project and i need to modify a table. Add some columns. I created this migration:

    public function up()
    {
        Schema::table('contact_details', function ($table) {
            $table->string('uid');
            $table->string('university')->nullable();
            $table->string('graduation')->nullable();
            $table->string('qualification')->nullable();
            $table->integer('voucher_1')->nullable();
            $table->integer('voucher_2')->nullable();
            $table->boolean('voucher_1_confirmed')->nullable();
            $table->boolean('voucher_2_confirmed')->nullable();
            $table->string('home_address')->nullable();
            $table->string('home_phone')->nullable();
            $table->string('company_name')->nullable();
            $table->string('company_position')->nullable();
            $table->string('company_address')->nullable();
            $table->string('company_phone')->nullable();
            $table->string('company_gsm')->nullable();
            $table->string('company_email')->nullable();
            $table->string('company_sphere')->nullable();
            $table->string('company_speciality')->nullable();
        });
    }

But when i run php artisan migrate, i get the following error:

  [Illuminate\Database\QueryException]                                                                                           
  SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time'   
  at row 1 (SQL: alter table `zu7gm_contact_details` add `uid` varchar(255) not null, add `university` varchar(255) null, add `  
  graduation` varchar(255) null, add `qualification` varchar(255) null, add `voucher_1` int null, add `voucher_2` int null, add  
   `voucher_1_confirmed` tinyint(1) null, add `voucher_2_confirmed` tinyint(1) null, add `home_address` varchar(255) null, add   
  `home_phone` varchar(255) null, add `company_name` varchar(255) null, add `company_position` varchar(255) null, add `company_  
  address` varchar(255) null, add `company_phone` varchar(255) null, add `company_gsm` varchar(255) null, add `company_email` v  
  archar(255) null, add `company_sphere` varchar(255) null, add `company_speciality` varchar(255) null)                          
                                                                                                                                 

                                                                                                                                 
  [PDOException]                                                                                                                 
  SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time'   
  at row 1                                                                                                                       

What may be causing this? The column in error is present and is datatime.

17 Aug
2 years ago

keevitaja started a new conversation Array Sorting Function Without PHP Array Functions

Hi!

I was given a test task to write a custom array sorting without using anything from the http://php.net/manual/en/ref.array.php

So basically just using loops and simple comparison. And i cannot do it.

How do you sort an [2, 7, 1, 4, 7] array without any of the functions from the link above. It seems like a major hassle or maybe i am just dumb.

17 Jul
2 years ago

keevitaja started a new conversation Caprute 'enter' Keypress With Vue

Hello,

i have a input field (no form) and i need to capture the 'enter' keypress event with the contents of the input field.

How can i do this with vue?

13 Jul
2 years ago

keevitaja started a new conversation VueJs Cannot Hande Identical Data In V-for

Hi, i am pretty sure it is me... so how to do it the correct way.

<div id="main">
    <p><a href="#" @click="append()">add</a></p>
    <p v-for="row in rows">{{{ row.data }}}</p>
</div>
'use strict';

let i = 1;

const main = new Vue({
    el: '#main',
    data: {
        rows: []
    },
    methods: {
        append: function() {
            this.rows.push({data: 'testing ...', id: i});
            i++;
        }
    }
});

This works as expected. Each time when i click append, the row gets appended. But if i try to push identical string this.rows.push('testing ...) then a row will appended only the after the first click,

20 Jun
2 years ago

keevitaja started a new conversation Nodejs: How To Know, If A Socket Stream Chunk Is A Partial Or Not?

"use strict";

const net = require('net');

const socket = net.createConnection(6555, '198.178.123.109', ()=> {
    console.log('Connected!');
});

socket.on('data', (chunk)=> {
    console.log(chunk); // is this chunk partial, or not?
});

The example above receives stream in 2 chunks before starts waiting for the username. How can i determin, that the first chunk is incomplete stream partial?