Skip to content

Instantly share code, notes, and snippets.

View jekingohel's full-sized avatar
🎯
Focusing

Jekin Gohel jekingohel

🎯
Focusing
View GitHub Profile
@jekingohel
jekingohel / Array.vue
Created January 6, 2022 10:06
Using Vue component in this gist link. Complete the computed property "activeItems". https://gist.github.com/anish-dcruz/1fa2af7357914750ee2e21f74db4231b
<template>
<div class="widget">
<div v-if="activeItems && activeItems.length > 0">
<ul>
<li v-for="item in activeItems" :key="item.id">
{{item.name}}
</li>
</ul>
</div>
</div>
@jekingohel
jekingohel / StoreCustomer.php
Created January 6, 2022 09:43
Using laravel's HTTP tests, test the CustomerController's store method, make sure to mock the mailable "WelcomeNewCustomer" using mail-fake.
<?php
namespace Tests\Feature;
use Tests\TestCase;
use App\Mail\WelcomeNewCustomer;
use Illuminate\Support\Facades\Mail;
class StoreCustomer extends TestCase
{
@jekingohel
jekingohel / CustomerController.php
Last active January 6, 2022 09:42
Write a service class that handles saving and sending email then rewrite the store method
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreCustomerRequest;
use App\Services\CustomerService;
class CustomerController extends Controller
{
public function store(StoreCustomerRequest $request,CustomerService $customerService)