Skip to content

Instantly share code, notes, and snippets.

@abdullahnaseer
Created January 2, 2022 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdullahnaseer/31a1ac0eac1ed4231d7dd2c2ca458d57 to your computer and use it in GitHub Desktop.
Save abdullahnaseer/31a1ac0eac1ed4231d7dd2c2ca458d57 to your computer and use it in GitHub Desktop.
CustomerService - Evaluation of Laravel
<?php
namespace App\Services;
use App\Mail\WelcomeNewCustomer;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
class CustomerService
{
/**
* Store a new Customer.
*
* @param array $data
*
* @return void
*/
public function add(array $data): void
{
DB::table('customers')->insert($data);
Mail::to($data['email'])->send(new WelcomeNewCustomer($data));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment