Skip to content

Commit

Permalink
use nameslug
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Jul 13, 2023
1 parent 2a90840 commit f834776
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
use App\Models\Contact;
use App\Models\Vault;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;

class ContactVCardController extends Controller
{
public function download(Request $request, Vault $vault, Contact $contact)
{
$carddata = $this->exportVCard($vault->id, $contact->id);
$cardData = $this->exportVCard($vault->id, $contact->id);
$name = Str::of($contact->name)->slug(language: App::getLocale());

return response()->streamDownload(function () use ($carddata) {
echo $carddata;
}, $contact->id.'.vcf', [
'Content-Type' => 'text/vcard',
], 'inline');
return response()->streamDownload(function () use ($cardData) {
echo $cardData;
}, "$name.vcf", ['Content-Type' => 'text/vcard'], 'inline');
}

/**
Expand Down

0 comments on commit f834776

Please sign in to comment.