<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
AuditLog.create!(
actor_id: current_user.id,
action: 'member.approve',
target_type: 'Member',
target_id: member.id,
ip_address: request.remote_ip,
use std::fmt;
#[derive(Debug)]
pub enum HashError {
Backend(String),
InvalidHash,
import { S3Client } from "@aws-sdk/client-s3";
import { createPresignedPost, PresignedPost } from "@aws-sdk/s3-presigned-post";
import { randomUUID } from "crypto";
const s3 = new S3Client({ region: process.env.AWS_REGION });
const BUCKET = process.env.UPLOAD_BUCKET!;
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
// rawBody: true preserves the exact bytes Stripe signed
const app = await NestFactory.create(AppModule, { rawBody: true });
# Optimized production Dockerfile
# Stage 1: Dependencies
FROM node:20-alpine AS deps
WORKDIR /app
package com.example.myapp.data.local
import android.content.Context
import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
<?php
namespace App\Models\Scopes;
use App\Support\TenantContext;
use Illuminate\Database\Eloquent\Builder;
package com.example.audit.config;
import java.util.Optional;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
class Current < ActiveSupport::CurrentAttributes
attribute :tenant, :request_id
def tenant=(tenant)
super
Rails.logger.tagged("tenant=#{tenant&.id}") if tenant
package com.example.security;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Value;
import { SetMetadata } from '@nestjs/common';
export enum Role {
User = 'user',
Editor = 'editor',
Admin = 'admin',