本文整理汇总了PHP中app\models\Invitation::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::where方法的具体用法?PHP Invitation::where怎么用?PHP Invitation::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Invitation
的用法示例。
在下文中一共展示了Invitation::where方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCredentials
/**
* Get the needed authorization credentials from the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
protected function getCredentials(Request $request)
{
$credentials = $request->only('password');
$credentials['id'] = null;
$invitation_key = session('invitation_key');
if ($invitation_key) {
$invitation = Invitation::where('invitation_key', '=', $invitation_key)->first();
if ($invitation && !$invitation->is_deleted) {
$credentials['id'] = $invitation->contact_id;
}
}
return $credentials;
}
示例2: getClientDatatable
public function getClientDatatable()
{
$search = Input::get('sSearch');
$invitationKey = Session::get('invitation_key');
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();
if (!$invitation || $invitation->is_deleted) {
return [];
}
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
return [];
}
return $this->invoiceRepo->getClientDatatable($invitation->contact_id, ENTITY_QUOTE, $search);
}
示例3: create
public function create()
{
$this->validateRoute();
$user = $this->getRepository()->createOrUpdate($this->request->all());
$sandboxData = [];
if (env('APP_ENV') == 'local') {
$sandboxData['token_email'] = $user->getVerifyEmailToken();
}
$invitation = Invitation::where('email', $user->email)->get();
foreach ($invitation as $item) {
if (array_key_exists('_id', $item->project)) {
$application = Application::find($item->project['_id']);
if (!$application->getUser($user->email)) {
$application->setUser(['user_id' => (string) $user->_id, 'role' => $item->role, 'scope' => $item->scope])->save();
}
}
}
return $this->response->json($user->toArray(), Response::HTTP_CREATED, [], [], $sandboxData);
}
示例4: showResetForm
/**
* Display the password reset view for the given token.
*
* If no token is present, display the link request form.
*
* @param \Illuminate\Http\Request $request
* @param string|null $key
* @param string|null $token
* @return \Illuminate\Http\Response
*/
public function showResetForm(Request $request, $key = null, $token = null)
{
if (is_null($token)) {
return $this->getEmail();
}
$data = compact('token');
if ($key) {
$contact = Contact::where('contact_key', '=', $key)->first();
if ($contact && !$contact->is_deleted) {
$account = $contact->account;
$data['contact_key'] = $contact->contact_key;
} else {
// Maybe it's an invitation key
$invitation = Invitation::where('invitation_key', '=', $key)->first();
if ($invitation && !$invitation->is_deleted) {
$account = $invitation->account;
$data['contact_key'] = $invitation->contact->contact_key;
}
}
if (!empty($account)) {
$data['account'] = $account;
$data['clientFontUrl'] = $account->getFontsUrl();
} else {
return \Redirect::to('/client/sessionexpired');
}
}
return view('clientauth.reset')->with($data);
}
示例5: findInvoiceByInvitation
public function findInvoiceByInvitation($invitationKey)
{
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();
if (!$invitation) {
app()->abort(404, trans('texts.invoice_not_found'));
}
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
app()->abort(404, trans('texts.invoice_not_found'));
}
$invoice->load('user', 'invoice_items', 'invoice_design', 'account.country', 'client.contacts', 'client.country');
$client = $invoice->client;
if (!$client || $client->is_deleted) {
app()->abort(404, trans('texts.invoice_not_found'));
}
return $invitation;
}
示例6: getClientDatatable
public function getClientDatatable()
{
$search = Input::get('sSearch');
$invitationKey = Session::get('invitation_key');
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->with('contact.client')->first();
if (!$invitation) {
return [];
}
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
return [];
}
$payments = $this->paymentRepo->findForContact($invitation->contact->id, Input::get('sSearch'));
return Datatable::query($payments)->addColumn('invoice_number', function ($model) {
return $model->invitation_key ? link_to('/view/' . $model->invitation_key, $model->invoice_number) : $model->invoice_number;
})->addColumn('transaction_reference', function ($model) {
return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>';
})->addColumn('payment_type', function ($model) {
return $model->payment_type ? $model->payment_type : ($model->account_gateway_id ? '<i>Online payment</i>' : '');
})->addColumn('amount', function ($model) {
return Utils::formatMoney($model->amount, $model->currency_id);
})->addColumn('payment_date', function ($model) {
return Utils::dateToString($model->payment_date);
})->make();
}
示例7: findInvoiceByInvitation
public function findInvoiceByInvitation($invitationKey)
{
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();
if (!$invitation) {
return false;
}
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
return false;
}
$invoice->load('user', 'invoice_items', 'invoice_design', 'account.country', 'client.contacts', 'client.country');
$client = $invoice->client;
if (!$client || $client->is_deleted) {
return false;
}
return $invitation;
}
示例8: getInvitation
private function getInvitation()
{
$invitationKey = session('invitation_key');
if (!$invitationKey) {
return false;
}
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();
if (!$invitation || $invitation->is_deleted) {
return false;
}
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
return false;
}
return $invitation;
}
示例9: view
public function view($invitationKey)
{
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->firstOrFail();
$invoice = $invitation->invoice;
if (!$invoice || $invoice->is_deleted) {
return View::make('invoices.deleted');
}
$invoice->load('user', 'invoice_items', 'invoice_design', 'account.country', 'client.contacts', 'client.country');
$client = $invoice->client;
$account = $client->account;
if (!$client || $client->is_deleted) {
return View::make('invoices.deleted');
}
if ($account->subdomain) {
$server = explode('.', Request::server('HTTP_HOST'));
$subdomain = $server[0];
if (!in_array($subdomain, ['app', 'www']) && $subdomain != $account->subdomain) {
return View::make('invoices.deleted');
}
}
if (!Session::has($invitationKey) && (!Auth::check() || Auth::user()->account_id != $invoice->account_id)) {
Activity::viewInvoice($invitation);
Event::fire(new InvoiceViewed($invoice));
}
Session::set($invitationKey, true);
Session::set('invitation_key', $invitationKey);
$account->loadLocalizationSettings();
$invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
$invoice->due_date = Utils::fromSqlDate($invoice->due_date);
$invoice->is_pro = $account->isPro();
if ($invoice->invoice_design_id == CUSTOM_DESIGN) {
$invoice->invoice_design->javascript = $account->custom_design;
} else {
$invoice->invoice_design->javascript = $invoice->invoice_design->pdfmake;
}
$contact = $invitation->contact;
$contact->setVisible(['first_name', 'last_name', 'email', 'phone']);
// Determine payment options
$paymentTypes = [];
if ($client->getGatewayToken()) {
$paymentTypes[] = ['url' => URL::to("payment/{$invitation->invitation_key}/token"), 'label' => trans('texts.use_card_on_file')];
}
foreach (Gateway::$paymentTypes as $type) {
if ($account->getGatewayByType($type)) {
$typeLink = strtolower(str_replace('PAYMENT_TYPE_', '', $type));
$paymentTypes[] = ['url' => URL::to("/payment/{$invitation->invitation_key}/{$typeLink}"), 'label' => trans('texts.' . strtolower($type))];
}
}
$paymentURL = '';
if (count($paymentTypes)) {
$paymentURL = $paymentTypes[0]['url'];
}
$data = array('isConverted' => $invoice->quote_invoice_id ? true : false, 'showBreadcrumbs' => false, 'hideLogo' => $account->isWhiteLabel(), 'invoice' => $invoice->hidePrivateFields(), 'invitation' => $invitation, 'invoiceLabels' => $account->getInvoiceLabels(), 'contact' => $contact, 'paymentTypes' => $paymentTypes, 'paymentURL' => $paymentURL);
return View::make('invoices.view', $data);
}
示例10: reset
/**
* Reset the given user's password.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function reset(Request $request)
{
$this->validate($request, $this->getResetValidationRules());
$credentials = $request->only('password', 'password_confirmation', 'token');
$credentials['id'] = null;
$invitation_key = $request->input('invitation_key');
if ($invitation_key) {
$invitation = Invitation::where('invitation_key', '=', $invitation_key)->first();
if ($invitation && !$invitation->is_deleted) {
$credentials['id'] = $invitation->contact_id;
}
}
$broker = $this->getBroker();
$response = Password::broker($broker)->reset($credentials, function ($user, $password) {
$this->resetPassword($user, $password);
});
switch ($response) {
case Password::PASSWORD_RESET:
return $this->getResetSuccessResponse($response);
default:
return $this->getResetFailureResponse($request, $response);
}
}