<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use PhpParser\Node\Expr\New_;

class Message extends Model
{
    private static $message;
    use HasFactory;

    public static function newMessage($request)
    {
        self::$message = New Message();
        self::$message->date    = date('Y-m-d');
        self::$message->name    = $request->name;
        self::$message->email   = $request->email;
        self::$message->phone   = $request->phone;
        self::$message->subject = $request->subject;
        self::$message->message = $request->message;
        self::$message->save();

    }
}
