Skip to content

Link Expiry feature#378

Open
saivasanth wants to merge 8 commits intocydrobolt:masterfrom
saivasanth:master
Open

Link Expiry feature#378
saivasanth wants to merge 8 commits intocydrobolt:masterfrom
saivasanth:master

Conversation

@saivasanth
Copy link
Copy Markdown

I am adding link expiry feature for valid the link upto certain time and provide option, the link do not expiry

$custom_ending = $request->input('custom-ending');
$is_secret = ($request->input('options') == "s" ? true : false);
$is_expried = ($request->input('is_expried') == 'yes' ? true : false);
$expried_date = isset($request->input('expried_date'))?Carbon::parse(date_format($request->input('expried_date'),'Y-m-d'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use $request->has() here


try {
$short_url = LinkFactory::createLink($long_url, $is_secret, $custom_ending, $link_ip, $creator);
$short_url = LinkFactory::createLink($long_url, $is_secret, $custom_ending, $link_ip, $creator,false,false$is_expried,$expried_date);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be space between these params.


}

->first();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alignment of this block looks a bit strange, maybe reformat it?

$table->boolean('is_custom')->default(0);
$table->boolean('is_api')->default(0);
$table->boolean('is_expried')->default(0);
$table->date('expried_date')->nullable();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be expiry_date or expires_at

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this should be in a new migration so existing users can get the functionality

Copy link
Copy Markdown
Contributor

@overint overint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See PR feedback.

</div>
@endif

<p>Link Expried ?</p>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This layout is quite wonky. Let's fix the grammatical errors here and figure out a way to better lay these settings out. What about a modal for "advanced settings" or a horizontal grid layout for each specific link setting?

Copy link
Copy Markdown
Owner

@cydrobolt cydrobolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix layout & other PR issues.

@urbaez22
Copy link
Copy Markdown

Hi,
Does this feature were successfully merged..? Or it's not available?
Thanks..

@brknkfr
Copy link
Copy Markdown

brknkfr commented Feb 3, 2022

Just in case someone is looking for an expiry feature. Check out this pull request: #615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants