2 Commits

Author SHA1 Message Date
54ea22c49a chore: update RoadRunner and PHP versions in Dockerfile (#10)
All checks were successful
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 1m23s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 1m14s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m31s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m37s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m27s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m44s
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Successful in 10m37s
🏗️✨ Build Workflow / 🖥️ 🔨 Build Migrations (push) Successful in 1m33s
Reviewed-on: #10
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
2025-11-07 04:36:49 +00:00
f8d3462cb7 added example model (#9)
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 2m56s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m47s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 2m55s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 2m44s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 3m8s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m48s
Reviewed-on: #9
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
2025-10-21 17:23:18 +00:00
3 changed files with 60 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
# Use the RoadRunner image as a base for the first stage # Use the RoadRunner image as a base for the first stage
FROM ghcr.io/roadrunner-server/roadrunner:2025.1.1 AS roadrunner FROM ghcr.io/roadrunner-server/roadrunner:2025.1.4 AS roadrunner
# Use the official Composer image as the base for the library stage # Use the official Composer image as the base for the library stage
FROM siteworxpro/composer AS library FROM siteworxpro/composer AS library
@@ -12,7 +12,7 @@ RUN composer install --optimize-autoloader --ignore-platform-reqs --no-dev
# Use the official PHP CLI image with Alpine Linux for the second stage # Use the official PHP CLI image with Alpine Linux for the second stage
FROM php:8.4.6-alpine AS php FROM php:8.4.14-alpine AS php
# Move the production PHP configuration file to the default location # Move the production PHP configuration file to the default location
RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \ RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \

View File

@@ -6,6 +6,12 @@ namespace Siteworxpro\App\Models;
use Illuminate\Database\Eloquent\Model as ORM; use Illuminate\Database\Eloquent\Model as ORM;
/**
* Class Model
*
* @package Siteworxpro\App\Models
*/
abstract class Model extends ORM abstract class Model extends ORM
{ {
protected $dateFormat = 'Y-m-d H:i:s';
} }

52
src/Models/User.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Models;
use Carbon\Carbon;
/**
* Class User
*
* @property string $id
* @property string $first_name
* @property string $last_name
* @property string $email
* @property string $password
* @property Carbon $created_at
*
* @property-read string $full_name
* @property-read string $formatted_email
*/
class User extends Model
{
protected $casts = [
'created_at' => 'datetime',
];
protected $hidden = [
'password',
];
protected $fillable = [
'first_name',
'last_name',
'email',
'password',
];
public function getFullNameAttribute(): string
{
return "$this->first_name $this->last_name";
}
public function getFormattedEmailAttribute(): string
{
return sprintf(
'%s <%s>',
$this->getFullNameAttribute(),
strtolower($this->email)
);
}
}