title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
- Under Development
- @gbeilaaliuwahab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use App\Jobs\ExampleJob; | |
use App\User; | |
use Illuminate\Support\Facades\Bus; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class ExampleTest extends TestCase | |
{ | |
use RefreshDatabase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @test */ | |
public function test_event_mocking() | |
{ | |
Event::fake(); | |
// Perform order shipping... | |
Event::assertDispatched(OrderShipped::class, function ($e) use ($order) { | |
return $e->order->id === $order->id; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Jobs; | |
use App\User; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Foundation\Bus\Dispatchable; | |
use Illuminate\Support\Facades\Log; | |
class ExampleJob implements ShouldQueue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use App\Jobs\ExampleJob; | |
use App\User; | |
use Illuminate\Support\Facades\Bus; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class ExampleTest extends TestCase | |
{ | |
use RefreshDatabase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*@Param String username | |
*/ | |
public function getUserGithubScores($username) | |
{ | |
//initialise guzzle http client; | |
$client = new Client(); | |
try { | |
//make a get request to github | |
$res = $client->get('https://api.github.com/users/'.$username.'/events/public'); |