matask

Experience

15,470

0 Best Reply Awards

  • Member Since 8 Months Ago
  • 151 Lessons Completed
  • 0 Favorites

14th September, 2017

matask started a new conversation Atom IDE-PHP Doesn't Work • 1 week ago

Hello,

Has anyone tried the ide-php on atom beta? For some reason it doesn't work for me, it says in the bottom "PHP(FelixFBecker) started" but if i try to do anything i get a never ending blue circle with a spinner around it. I pointed the package to my php directory which is C:\php. Help please.

Thank you

1st September, 2017

matask started a new conversation Laravel PHP Code In Vue Components • 2 weeks ago

Hello,

So I was thinking it would be useful if I could use Laravel code, like helper functions, inside Vue Components but can't come up with a good solution. The only way to do this in my mind would be to send an Http request with a string which the PHP in the Controller then would eval() and run actual code that you want it to and return a response, but then anyone could run such code on a server so this is not a good solution.

There needs to be some way for the server to check if this request is coming from a feature implemented by the developer and not from a user or anyone else. The simplest way would be to code different paths for different helpers but maybe it's possible with just one path and one method?

Thanks

6th June, 2017

matask started a new conversation PHPUnit Defaults To "/" • 3 months ago

Greetings,

In PHPUnit when i try to

$this->get('/en/login);

If I do

dd(request()->path()); // In my web.php file

It shows up as "/".

Basically the problem is that I want the path to be the one that I was trying to get and not "/". Any ideas how I can fix this?

Thank you :)

5th June, 2017

matask started a new conversation Route Filters • 3 months ago

Greetings,

In my web.php there's a route group

Route::group(['prefix' => $prefix], function($route) {
    // Some Routes
}

Also there's middleware class for setting a Locale based on the prefix.

When I'm running tests, the behaviour of the tests seems very different from how it is in the browser. I'm getting way too many redirects where I should be getting a 200 status.

In Postman if I go to '/en/login' I get a 200, in PHPUnit I get a 302 response.

Any ideas what could be going on here?

Thank you!

31st May, 2017

matask left a reply on Question About AsertSee • 3 months ago

It's here https://laravel.com/docs/5.4/dusk#available-assertions . But you don't have to use browsers with dusk you can just do something like $this->get('/')-assertSee('Content').

matask started a new conversation Question About AsertSee • 3 months ago

Greetings,

I'm writing a test where I register a new user and assertSee if I see a "Welcome, $name" message on the home page, to assert that a user was registered and logged in. I could also use Auth check or compare that the logged in user is the user that I just regsitered. Advantage of the Auth check is if I change the front-end welcome message, my test will still pass. Advantage of the assertSee is that I test my front-end as well.

Which one is the better approach, or maybe it doesn't matter?

Thank you :)

24th May, 2017

matask started a new conversation Testing Validation • 3 months ago

Greetings,

In my app, when a user registers, there's validation for many fields and most of them are the same 'required|string'. My question is - do i need to write tests for all the fields, to test if the validation passes? But I think this doesn't make sense because If I just test one of them and it works, it means the other 'required|string' validations will work too, so there might be no need for writing many tests which will essentially be the same. I appreciate any thoughts you have about this :) Thank you.

26th February, 2017

matask left a reply on Data In Components • 6 months ago

I solved this by doing:

watch: {
    products: function() {
        // do something
    }
}

24th February, 2017

matask started a new conversation Data In Components • 6 months ago

Hello,

Here's the code:

<script>
    export default {

        data() {
            return {
                products: null,
            }
        },

        mounted() {

            console.log(this.products);

            axios.get('/products')
                .then(response =>
                    this.products = response.data,
                );

            console.log(this.products);
        }

</script>

I want to execute a function as soon as the page loads and check the value of this.products , but the property doesn't change right after after the call to axios.get, It's only changed when the page loads(I see it in Vue dev). Both console.log calls return null. What method do I need to call, so that when I call it, this.products already has a value that I set with axios? Thank you.

Edit Your Profile
Update

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