To convert a Jalali date to a timestamp, you can use the makeCarbon method provided by the morilog/jalali package. Here's an example:
use Morilog\Jalali\Jalalian;
public function store(Product $product, Warranty $warranty, Request $request)
{
$colors = $request->post('color');
$date = $request->post('date');
$timestamp = Jalalian::fromFormat('Y/m/d H:i:s', $date)->getTimestamp();
dd($timestamp);
}
In this example, we're using the fromFormat method to create a Jalalian instance from the input date string. We're assuming that the input date string is in the format Y/m/d H:i:s, but you can adjust this to match your specific input format.
Once we have a Jalalian instance, we can call the getTimestamp method to get the Unix timestamp equivalent. This timestamp can then be used with any PHP function that expects a Unix timestamp.
Note that the getTimestamp method returns the timestamp in seconds, so you may need to multiply it by 1000 if you need it in milliseconds.