Skip to content

Instantly share code, notes, and snippets.

@paradisetester
paradisetester / computed_property.vue
Created January 3, 2022 07:52
computed property "activeItems" done.
<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>
@paradisetester
paradisetester / CustomerController.php
Created January 3, 2022 08:01
service class that handles saving and sending email then rewrite the store method
<?php
namespace App\Http\Controllers;
use App\Providers\CustomerServiceProvider;
use Illuminate\Http\Request;
use App\Models\Customer;
use Validator;
class CustomerController extends Controller
{
@paradisetester
paradisetester / CustomerTest.php
Created January 3, 2022 08:03
Using laravel's HTTP tests
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class CustomerTest extends TestCase
{