i would like that user can choice the expire of a post, for example in the form of create post i will insert a input select option with: 24h, 48h, 72h.
My question, i need store the date of expire in my database, how can i calculate it?
I know that i can get the time of creation post like this:
VIEW - MY form have a input like this
// get the current time
$current = Carbon::now();
$current = new Carbon();
// maybe so ??
$expire_date = $current + $request->input('expire_date')
You can do something like that on your controller: assuming you have Input::all() on yoit request variable.
$expire_date = Carbon::now()->addHours($request->expire_date);
as you can see on carbon doc