Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Couldn't reach 'migarasathsara/unit-test-synthetic' on the Hub (LocalEntryNotFoundError)
Error code: UnexpectedError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
domain string | laravel_use_case string | laravel_code string | phpunit_test string |
|---|---|---|---|
E-Commerce | **Laravel E-Commerce Feature Description**
**1. User Authentication and Authorization**
- **Registration and Login**: Implement Laravel's built-in authentication to allow users to register and log in.
- **Role-Based Access Control**: Use Laravel's authorization features to manage user roles (admin, customer, etc.) an... | ```php
// User Model (app/Models/User.php)
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
class User extends Authentic... | ```php
// tests/Feature/ProductTest.php
namespace Tests\Feature;
use App\Models\Category;
use App\Models\Product;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
class ProductTest extends TestCase
{
... |
FinTech | **Feature: Secure User Authentication and Authorization**
- **Multi-factor Authentication (MFA)**
- Implement Laravel's built-in authentication system with additional MFA using a package like `pragmarx/google2fa-laravel`.
- Store MFA secrets in the `users` table and validate during login.
- **Role-Based Access Co... | ```php
// User Model with MFA and RBAC
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
use PragmaRX\Google2FA\Google2FA;
class User extends Authenticatable
{
use HasApiTokens, Notifiable, HasRo... | ```php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Artisan;
use Tests\TestCase;
use App\Models\User;
use App\Models\Transaction;
use App\Events\TransactionCreated;
class TransactionTest extends TestCase
{
use RefreshDatabase, WithFa... |
Healthcare | **Laravel Feature Description for Healthcare Domain**
1. **Electronic Health Records (EHR) System**
- **Patient Records Management**
- Create, Read, Update, Delete (CRUD) operations for patient demographics, medical history, allergies, medications, and immunizations.
- Soft deletes for patient records wit... | ```php
// Patient.php (Model)
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\MedicalHistory;
use App\Models\Allergy;
use App\Models\Medication;
use App\Models\Immunization;
class Patient extends Model
{
use SoftDeletes;
protected $fi... | ```php
// tests/Feature/PatientTest.php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\Patient;
class PatientTest extends TestCase
{
use RefreshDatabase;
public function test_store_patient_success()
... |
Social Good | ### Laravel Feature Description for Social Good
#### 1. **User Management**
- **User Registration and Authentication**
- Email and password-based registration.
- Social media login integration (Google, Facebook, Twitter).
- Two-factor authentication for enhanced security.
- Password reset functionality.
- **... | ### User Management
#### User Model with Relationships
```php
// app/Models/User.php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
... | ```php
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\User;
use App\Models\Donation;
use App\Models\VolunteerActivity;
use App\Models\Post;
use App\Models\Forum;
class UserManagementTest extends TestCas... |
E-Commerce | **Laravel E-Commerce Feature Implementation**
1. **User Authentication and Authorization**
- Laravel UI for authentication scaffolding (login, registration, password reset).
- Role-based access control using Laravel's built-in gate and policy features.
- Admin panel for user management.
2. **Product Manageme... | ### 1. User Authentication and Authorization
**User Model:**
```php
php artisan make:model User -m
```
**User Migration:**
```php
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nulla... | ```php
<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\User;
use App\Models\Product;
use App\Models\Cart;
use App\Models\Order;
use App\Models\Review;
use App\Models\Wishlist;
use App\Models\Newsletter;
use App\Models\Coupon;
cla... |
E-Commerce | ### Laravel Feature Description for E-Commerce
#### 1. User Authentication and Authorization
- **Features:**
- Registration and Login
- Password Reset
- Email Verification
- Role-Based Access Control (Admin, Customer, Guest)
- Social Media Login (Google, Facebook, Twitter)
#### 2. Product Management
- **Fea... | ### Models with Relationships
```php
// User.php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, Notifiable;
protected $fillable = [
'name',... | ```php
// tests/Feature/AuthControllerTest.php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use App\Models\User;
class AuthControllerTest extends TestCase
{
use RefreshDatabase;
public function test_user_can_register()
{
$response = $this->post('... |
Education | **Feature: Online Course Management System**
1. **User Authentication and Authorization**
- **Admin**: Manages the platform, courses, and users.
- **Instructor**: Creates and manages courses, enrolls students, and grades assignments.
- **Student**: Enrolls in courses, accesses learning materials, submits assi... | ### Models with Relationships
```php
// User.php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
protected $fillable = [
'name', 'email', 'password', 'role'
];
public function courses()
{
return $this->belongsToMany(C... | ```php
<?php
namespace Tests\Feature;
use App\Models\Course;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class CourseTest extends TestCase
{
use RefreshDatabase, WithFaker;
/** @test */
public function an_admin_... |
Education | ### Laravel Feature Description for Education Domain
#### 1. **User Authentication and Authorization**
- **Features**:
- **Student Registration**: Allow students to create accounts using email, social media, or institutional email.
- **Teacher Registration**: Separate registration process for teachers wit... | ```php
// User.php (Model)
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, Notifiable;
protected $fillable = [
'name', 'email', 'password', '... | ```php
// tests/Feature/UserRegistrationTest.php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\User;
class UserRegistrationTest extends TestCase
{
use RefreshDatabase;
public function test_user_can_r... |
Education | ### Feature 1: Student Management System
**Functionality:**
- **Student Registration:** Students can register for courses via a web portal. The system validates input data, including email, phone number, and course preferences.
- **Profile Management:** Students can update their profile information, including personal... | ### Models with Relationships
**Student.php**
```php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
use HasFactory;
protected $fillable = [
'name', 'email', 'phone', 'date_of_birth', 'address'
];
... | ```php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\Student;
use App\Models\Course;
use App\Models\Enrollment;
use App\Models\Attendance;
use App\Models\Grade;
use App\Models\Instructor;
use App\Models\CourseContent;
use App\Models\An... |
Education | "**Feature: Course Management System**\n\n**Models:**\n\n1. **Course**\n - id (Integer, Primary Ke(...TRUNCATED) | "```php\n// models/Course.php\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factori(...TRUNCATED) | "```php\n// tests/Feature/CourseTest.php\nnamespace Tests\\Feature;\n\nuse App\\Models\\Course;\nuse(...TRUNCATED) |
End of preview.
README.md exists but content is empty.
- Downloads last month
- 5