ArthurGuy

ArthurGuy

Member Since 5 Years Ago

Brighton, England

Experience Points 8,350
Experience Level 2

1,650 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 110
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

06 Apr
1 year ago

ArthurGuy left a reply on Using A Secret Store For DB And Or .env Credentials

Good point!

I was hoping this would have been a solved problem and there would be a "right way" to do it.

Coming up with your own solutions always leaves me worried that there is a much better solution just around the corner!

ArthurGuy left a reply on Using A Secret Store For DB And Or .env Credentials

I believe it might be possible to tie into an event, certainly not as clean as a web hook but there is something.

I hadn't really thought about editing the env file or another config file from within the app but I imagine its safe enough.

I suppose dumping them into a redis store is also an option.

ArthurGuy started a new conversation Using A Secret Store For DB And Or .env Credentials

I am investigating using the AWS Secrets Manager to hold DB credentials and manage rotation and was wondering if anyone has used a credential store with Laravel?

Because of the rotation of keys its not practical to bake the key retrieval into the sever deployment process, it needs to be part of the laravel application. But its not going to be viable retrieving details on every request.

Has anyone done anything like this? If so at what stage in the lifecycle do you retrieve keys from the store?

Thanks

24 Oct
1 year ago

ArthurGuy left a reply on Mocking Jobs For All Tests

I still need jobs to be run during tests, just not a particular one! I need some way to mock out or disable one specific job across all tests without impacting the others.

Jobs seem great but don't work with DI and are hard to test in useful ways. I learn this but then go back to using them after a few months!

Thanks for you help

ArthurGuy left a reply on Mocking Jobs For All Tests

The problem with declaring it within individual tests is it gets messy, loads of tests end up with expectJobs statements when they have nothing to do with the test in question.

All I really want to do is mock out the job across the test suite but I don't think jobs are versatile enough.

23 Oct
1 year ago

ArthurGuy left a reply on Mocking Jobs For All Tests

I can fake the dispatch bus but that prevents all jobs from being fired.

I was hoping I could mock the Job class but I suspect this is probably not going to be possible with built in functionality.

ArthurGuy started a new conversation Mocking Jobs For All Tests

Hi, I have a job that I would like to mock out of all tests, the job will get called from some test but not all so I can't use expectsJobs.

Is there a way of stopping the execution of a job for all tests?

Thanks

01 Mar
2 years ago

ArthurGuy left a reply on Performance Improvements - Lots Of DOM Elements

@logaretm Thanks, that's such an straightforward option!

28 Feb
2 years ago

ArthurGuy started a new conversation Performance Improvements - Lots Of DOM Elements

I have a page which includes several hundred dom elements through a v-for loop. I need to do something when a user clicks on one of these elements.

Back in my jquery days the best way to do this would be to bind a single listener onto the parent and then workout what called it, I am using an @click on the v-for elements which I suspect isn't very efficient.

Does anyone know of a good Vue way to do this?

Thanks

19 Jul
3 years ago

ArthurGuy left a reply on Queued Event Getting Added Multiple Times

After some investigation this is an issue with the underlying aws library, still no closer to explaining the behaviour though.

ArthurGuy started a new conversation Queued Event Getting Added Multiple Times

Hi all, I have a bit of an odd issue I am hoping someone may be able to help with.

I have a website with a registration process, once the user is registered a new user event is fired, the listener for this then adds 3 jobs to an sqs queue.

The problem I have is the first of these jobs is getting added to the queue over and over again. Nginx ends up timing out after 60 seconds because the php process never finishes. The job is then repeatedly placed onto the sqs queue, I ended up having to purge over 2.7 million entries from sqs.

The process of adding to the queue is a Laravel thing so I am not sure where to go with this. I have tried switching to a sync queue and everything works perfectly. Its just the first listener in the event service provider that's getting added continually.

Any advice with this would be appreciated!

12 Jun
3 years ago

ArthurGuy started a new conversation Error Logging With Queue Worker Failures

Hi all,

I am using the standard laravel events and the pusher broadcaster to send updates to the website front end but this is failing to work when used on production. The combination of an SQS queue (possibly any queue) and the pusher broadcaster is failing for me. If I switch the events to broadcast immediately they work or if I use a sync queue they work so I know pusher is setup correctly.

Something about this is failing and causing the jobs to end up in the failed jobs table, unfortunitly I don't have a corresponding error log anywhere.

Is there anything odd or unusual about error logging for background workers or does anyone know why pusher and a queue may not work?

Thanks

30 Mar
3 years ago

ArthurGuy started a new conversation Laravel Encryption With KMS

Hi, Has anyone used Amazon's KMS service with Laravel, specifically using it to protect the main encryption key?

24 Mar
3 years ago

ArthurGuy left a reply on EC2 Role Based Auth Credentials

It turns out that this does work but I was missing out the required permission for setting an object as public!

23 Mar
3 years ago

ArthurGuy started a new conversation EC2 Role Based Authentication

Hi,

I am running a Laravel application on an EC2 instance and I am trying to use role based authentication to save having to use a dedicated key and secret. Unfortunately this doesn't seem to be working for me as I get unauthenticated errors when making requests.

To test I have tried this from the command line using artisan tinker, if I use the aws sdk directly it works but if I go via the laravel Storage facade it doesn't.

This works

$s3 = new Aws\S3\S3Client();
$s3->putObject(['Bucket' => 'test-bucket', 'Key' => 'foo', 'Body' => 'bar']);

But this doesn't

\Storage::put('foo', 'bar'), 'public');

I have removed the credentials from the config file so the library should fall back to a role based key.

Has anyone got this working?

29 Jan
3 years ago

ArthurGuy left a reply on Can't Access My Model In Listener?

I don't suppose anyone managed to get to the bottom of this, I just ran into it again with another project.

05 Jan
3 years ago

ArthurGuy left a reply on Socialite: InvalidStateException In AbstractProvider.php

I believe my previous post is the cause and solution of this. If you're using cookies for the session there is no simple fix and as laravel doesn't support locking it's probably going to difficult for the other options too.

If anyone is interested I went into a bit more depth with the problem and solution. https://arthurguy.co.uk/blog/2015/12/laravel-session-problems

11 Dec
3 years ago

ArthurGuy left a reply on Socialite: InvalidStateException In AbstractProvider.php

I may have found a potential cause, in our application we have a background ajax request, if this lines up with the redirect request then the problem occurs. This happens because the ajax request returns the session without the state param and overrides the one set by the redirect request.

ArthurGuy left a reply on Socialite: InvalidStateException In AbstractProvider.php

I have been looking into this and I have traced the problem to the state value being set to the session before the redirect.

The state param is passed down with the session as part of the redirect request but by the time you return to the site the state param is gone from the session.

I don't know whats happening here, its possible the cookie isn't getting set properly or something could be overriding it.

Has anyone else made any progress with this?

24 Nov
3 years ago

ArthurGuy left a reply on Socialite Redirect / Config Problem

Its a bit of a hard one to explain. This is what I have in my routes file for testing along with the output.

echo config('services.linkedin.redirect');                      // http://foo.com

echo app()->runningInConsole() ? config('app.url') : url('/');  // https://foo.com

The redirect value in the config file uses the second line to generate the url but when accessed from the config data the url has changed, I believe something is changing the value in the config data but I don't know whats doing it.

23 Nov
3 years ago

ArthurGuy started a new conversation Socialite Redirect / Config Problem

Hi all, I am having a problem with the redirect socialite performs, despite the site being https the redirect url given to the provider is http. I have traced the problem to something odd in the services config file.

$linkedInBaseRedirectUrl = $app->runningInConsole() ? config('app.url') : url('/');
'linkedin' => [
        'client_id' => env('LINKEDIN_CLIENT_ID'),
        'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
        'redirect' => $linkedInBaseRedirectUrl . '/api/auth/linkedin/callback',
    ],

The url that is generated is an https url but by the time I access it from the config file it's not.

Has anyone experienced anything like this or knows why it might be happening?

Thanks

16 Nov
3 years ago

ArthurGuy left a reply on Testing Socialite

It looks like the basic socialite facade can be mocked using Laravel's default mocking ability but once you get past that I am not sure how to correctly mock the response.

\Socialite::shouldReceive('driver')->once()->with('linkedin')->andReturn(\Socialite::shouldReceive('user')->once());

This successfully mocks the following line of code

$linkedInUser = Socialite::driver('linkedin')->user();

What I need to do now is return a mock user object that matches the Laravel\Socialite\AbstractUser class, so far I haven't gotten this to work.

It's slightly annoying that this package was made available with no guidance on how to test it.

ArthurGuy left a reply on Using Both Codeception AND Laracasts Integrated Package?

I use both testing methods as I slowly move to phpunit and everything works fine. Both test suites are independent and run separately. If phpunit is installed have you tried running vendor/bin/phpunit

14 Nov
3 years ago

ArthurGuy started a new conversation Testing Socialite

Hi, I am using socialite for linked in login and I am trying to right some functional tests to check the controller login flow but I am having trouble mocking out the socialite library.

Has anyone done this? Do I need to mock the whole thing by hand or is the a quick way?

Thanks

13 Oct
3 years ago
12 Oct
3 years ago

ArthurGuy started a new conversation Failing Dependency Injection

Hi all, I am trying to write a functional test that replaces a dependency defined in a service provider with a mocked version. Unfortunately when I run the test it's not getting resolved correctly and fails when it can't find the constructor on the mock. __construct() does not exist on this mock object

Service Provider $this->app->bind(GovTalkInterface::class, GovTalk::class);

Within my test code $this->app->bind(GovTalkInterface::class, $govTalkMock);

When the test code runs the interface has already had the main class bound to it so when I try and bind again it works but then tries to access a constructor on the mock which fails. The mock doesn't have a constructor and even when I add one it doesn't make a difference.

Does anyone know why this error might occur or how this should be done?

Thanks

23 Sep
3 years ago

ArthurGuy started a new conversation Sqlite Migrations Failing

Hi all, I recently added a column change to my db but this is causing migrations to fail when run against the sqlite test db.

It's complaining about not finding a column name and then proceeding to take ages completing the rest of the tests because of a table lock issue.

The output of my travis build shows the errors https://travis-ci.org/ArthurGuy/BBMembershipSystem/builds/80595599#L788

I have the doctrine dbal library installed and I haven't had problems with other migrations like this.

Does anyone know what could be going wrong?

Thanks

19 Aug
3 years ago

ArthurGuy left a reply on Can't Access My Model In Listener?

I have just run into this issue, the only fix I can see is to use the ShouldQueue interface but it's not an event I want to queue!

01 Aug
3 years ago

ArthurGuy left a reply on Forge Now Accepting Only 1GB Instances!

I still can't see the 512Mb Instances, odd

31 Jul
3 years ago

ArthurGuy left a reply on Forge Alternatives

Thanks, I didn't realise that was what Phansible was! So much control and yet so simple to use :)

ArthurGuy left a reply on Forge Now Accepting Only 1GB Instances!

Does anyone know when they will be re enabled?

ArthurGuy started a new conversation L5.1 Custom Mail Driver

Hi, I would like to create a custom mail driver in a 5.1 app but I can't find any information on how to implement this. The TransportManager class has various methods for the inbuilt drivers so I am worried it isn't possible to extend this.

Does anyone know if it can be done?

Thanks

28 Jul
3 years ago

ArthurGuy left a reply on Forge Alternatives

I like that. I am looking for a more generalised point a click solution that will work with aws and digital ocean but I will check that out. Thanks

ArthurGuy started a new conversation Forge Alternatives

Hi all,

I was wondering if anyone has got any recommendations for alternatives to Forge. I use it along with Envoyer for managing my sites but I would like to be able to provision servers with a little more control, for example I don't necessarily want to include a database server.

Does anyone know of a similar service or even an open source alternative?

Thanks

19 Jul
4 years ago

ArthurGuy left a reply on Class Not Being Found

I didn't think I could really go wrong here given the simplicity of the word Models but it seems like the case change didn't make its way to the server.

Thanks!

ArthurGuy started a new conversation Class Not Being Found

Hi, I have run into an odd problem and I am hoping someone can help.

I am trying to use a model from within a service provider but for some reason this works on my local environment but not when deployed. I played around with this a bit and found that I cannot access a class from a service provider if it's being stored in the App\Models directory.

From within a service provider boot method the following works new \App\Test(); new \App\Listeners\Test();

But this doesn't new \App\Models\Test();

There seems to be something odd about the models namespace that only seems to cause problems with the service provider.

Does anyone have any ideas what might cause this?

21 Jun
4 years ago

ArthurGuy left a reply on Unable To Test Select Fields With Array Names (5.1)

I have just run into the same issue, I think it's just one of many limitations with the in build test framework

10 Jun
4 years ago

ArthurGuy left a reply on Envoyer.io And Elixir?

I guess the ideal is for the deployment server (Envoyer) to run the build steps and then put the source code along with the build files onto the server.

Although I doubt that's ever going to be an option.

ArthurGuy left a reply on 5.1 Testing Database

It looks like that bit is working correctly, it's just not using the values from the phpunit.xml file when model observers are run

ArthurGuy left a reply on 5.1 Testing Database

It looks like there is a problem with the observers, if I comment out my model observers the test works correctly.

Not sure how but it looks like they are not running under the test environment.

ArthurGuy left a reply on 5.1 Testing Database

This is basically what I have except with an sqlite database, the problem is the error message I am getting is referring to the mysql database

ArthurGuy left a reply on I'm Having Trouble Making A Basic Broadcast Work

I had the same problem, have you added the broadcast service provider to your app.php config file and added the broadcast.php config file?

ArthurGuy started a new conversation 5.1 Testing Database

How do you specify the database driver for the phpunit tests?

I have replaced the default driver in the database.php config file with an environment variable and set this in the phpunit.xml file but it doesn't seem to work.

Is this how you're supposed to override environment variables for testing?

Thanks

02 Jun
4 years ago

ArthurGuy started a new conversation 5.1 Phpunit Tests Fail Without Middleware

I am working with the phpunit testing framework as part of 5.1, in the docs it talks about using the WithoutMiddleware trait to disable middleware, unfortunately as soon as I do this all my tests fail as everything seems to rely on the StartSession middleware.

Has anyone else been able to disable middleware and keep their tests running?

Thanks

31 May
4 years ago

ArthurGuy left a reply on L5.1 Cookie Session Failing

After a bit more looking it seems that cookie based sessions are fine until an exception is thrown.

If I throw an exception and handle it in the exception handlers render method then cookie based sessions get destroyed.

ArthurGuy left a reply on L5.1 Cookie Session Failing

I did come across that thread when looking into the problem and it seems to be unrelated, I think that's more about sessions getting occasionally reset

30 May
4 years ago

ArthurGuy started a new conversation L5.1 Cookie Session Failing

Hi all, I am migrating a 4.2 site to 5.1 and I am having trouble storing session data using the cookie driver.

I am passing form validation errors in the session for display on the front end, the problem is this doesn't work at all for the cookie driver. If I switch to a file driver everything works perfectly.

Is there a known change in behaviour or perhaps a bug which might be causing this to fail?

If I dump out the contents of the session I get the following but I can't add any of my own data to it.

Array ( [_token] => FTWmSVLUuUndscAKu0iohd7JSSbG1IeBO6rSSHi8 [_previous] => Array ( [url] => https://bbms.buildbrighton.dev/password/forgotten ) [flash] => Array ( [old] => Array ( ) [new] => Array ( ) ) )

Anyone got any advice?

I had to go straight to 5.1 because I needed middleware parameters

06 Mar
4 years ago

ArthurGuy started a new conversation Behat 3 And Zombie.js

Hi all, I am trying to get zombie.js running with my behat js tests but after switching over to them from selenium I find that they take a really long time to execute. What would take a minute or two takes 15 with zombie.

Has anyone had any luck getting zombie running? After reading about zombie I was expecting it to be really fast.

Thanks

04 Feb
4 years ago

ArthurGuy started a new conversation Add Dates To The Forum Mobile View

No dates are displayed next to posts when viewed on mobile making it very difficult to gauge the posts relevance.