First steps, setup your project!
Composer
composer create-project --prefer-dist laravel/laravel <project-name>
class ChangeEmailController extends Controller | |
{ | |
public function index(Request $request) | |
{ | |
try { | |
$this->commandBus->handle(new ChangeEmailCommand($subscriptionId, $request->input('email')); | |
} catch (UnableToSendEmailChangeRequestException $exception) { |
<?php | |
final class CardActivationReminder extends Notification implements MailNotificationInterface | |
{ | |
use Queueable; | |
/** | |
* @var User | |
*/ | |
private $user; |
composer create-project --prefer-dist laravel/laravel laravel | |
Installing laravel/laravel (v6.0.0) | |
- Installing laravel/laravel (v6.0.0): Downloading (100%) | |
Created project in laravel | |
> @php -r "file_exists('.env') || copy('.env.example', '.env');" | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 80 installs, 0 updates, 0 removals | |
- Installing symfony/polyfill-ctype (v1.12.0): Loading from cache | |
- Installing phpoption/phpoption (1.5.0): Loading from cache |
[ | |
{ | |
"id": "8983891803", | |
"type": "DeleteEvent", | |
"actor": { | |
"id": 5872362, | |
"login": "bobbybouwmann", | |
"display_login": "bobbybouwmann", | |
"gravatar_id": "", | |
"url": "https://api.github.com/users/bobbybouwmann", |
<?php | |
namespace App; | |
use Carbon\Carbon; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model | |
{ | |
/** |
<?php | |
namespace App\Traits; | |
use Carbon\Carbon; | |
use DateTimeInterface; | |
use Jenssegers\Date\Date; | |
trait Dateable | |
{ |
I hereby claim:
To claim this, I am signing this object:
So I’m building a system that connects to multiple HR-applications. So I was thinking about using the Builder (Manager) pattern, like socialite is doing. So you can say this user is using HR-application AFAS so I new up a AFASProvider and do all my calls in there. And then I simply need to create a provider for each HR-application we support and I give them the same interface and make sure they all return the same information structure so I can work with that.
However the hard part here is that some HR-applications don’t support some functionalities that others do. So we were thinking about creating our own provider which can be used as well. So for example retrieve documents for a user is supported by AFAS but not by VISMA. So if the user is using the VISMA provider we need to make sure that for documents it’s using the local provider. Now that might not be
<?php | |
namespace App; | |
class Invoice extends Model | |
{ | |
protected $table = 'invoices'; | |
// Don't forget to add your fillables | |
protected $fillable = []; |