BikashKatwal

BikashKatwal

Member Since 11 Months Ago

Experience Points
13,960
Total
Experience

1,040 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
106
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 3
13,960 XP
Mar
02
4 months ago
Activity icon

Replied to SELECT Query To Get All The Data Of 7 Days

Thanks, @alanamadeus I have used the first approaches to fix the issue.

 u.expires_on BETWEEN DATE_SUB(DATE_ADD(CURRENT_DATE(), INTERVAL 1 MONTH), INTERVAL 1 WEEK) 
AND DATE_ADD(CURRENT_DATE(), INTERVAL 1 MONTH)
Feb
28
4 months ago
Activity icon

Started a new Conversation SELECT Query To Get All The Data Of 7 Days

DROP PROCEDURE IF EXISTS `get_users_halls`;
delimiter ;;
CREATE PROCEDURE `get_users_halls` ()
BEGIN
  
SELECT u.id , u.email,
    u.first_name,
    u.last_name,
    count(*) as total_halls,
    u.override_membership_price,
    CASE
        WHEN u.override_membership_price IS NULL THEN (((count(*)-1) * 50)+100)*0.1
            ELSE  u.override_membership_price * 0.1
    END AS gst_amount,
    CASE
        WHEN u.override_membership_price IS NULL THEN ((count(*)-1) * 50)+100
            ELSE u.override_membership_price
    END AS total_amount,
    u.subscription,
    u.expires_on,
    DATE_ADD(u.expires_on, INTERVAL 1 YEAR) as extended_date,
     CASE
        WHEN u.override_membership_price IS NULL THEN TRUE
            ELSE FALSE
        END AS display_info
        FROM users u INNER JOIn halls h ON u.id=h.user_id
WHERE u.id NOT IN (SELECT i.user_id FROM invoices i WHERE i.invoice_date=CURRENT_DATE()) 
AND u.expires_on = DATE_ADD(CURRENT_DATE(), INTERVAL 1 MONTH)
AND u.activated=1 AND u.subscription='yearly' group by u.id;
END;

The above gives the data whose invoice date is expiring 1 month from today's date. I have CRON job running the script, but I am also thinking if in any cases Job didn't run then all the invoice that needs to be generated within that time also need to be sent for the users. So I am planning to fetch the 7 days ahead data as well. So that all the users that have been missed also get the invoice including all the users whose date is expiring after 1 month(which the above scripts does), but I am also thinking to get the missing data. How can I do that any logic to do the task would be appreciated.

Feb
27
4 months ago
Activity icon

Replied to 0 Is Not Being Displayed In Input Field

@jlrdw it can also be null. User can just leave the field without adding any value so it has to be treated as null. The condition for the field is either null, 0 or greater than 0. Based on this value the other logic are used.

Activity icon

Replied to 0 Is Not Being Displayed In Input Field

@yes it displayed all other values including 0 with the aforementioned line of code. but not sure if that is the correct way of handling such a situation.

Activity icon

Replied to 0 Is Not Being Displayed In Input Field

@jlrdw the field is varchar. It should either be NUll/Empty, or 0, or should be greater than 0.

Activity icon

Replied to 0 Is Not Being Displayed In Input Field

@jlrdw

    @include( 'admin.partials.form_row', array( 'name'=>"override_membership_price", 'label'=>"Override Membership Price", 'input'=>Form::input('text','override_membership_price', (isset($data->override_membership_price)||is_null($data->override_membership_price) || empty($data->override_membership_price)? $data->override_membership_price:0))))

Now I did this and it is displaying 0 as well but I am not sure if this is the correct way.

Activity icon

Started a new Conversation 0 Is Not Being Displayed In Input Field

I have saved 0 in the database, but when I try to edit 0 is not being displayed in the input field. However, 0 exist in the database. The field shows blank when I try to edit. What should I do, If I have to display any values saved in the database, datatype of the column is varchar(255)?

Activity icon

Started a new Conversation Issue While Migrating Table In Homestead Database

  Illuminate\Database\QueryException  : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = blog 
    and table_name = migrations and table_type = 'BASE TABLE')

  at D:\Tutorials\Laravel\project\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673| 

  Exception trace:

  1   PDOException::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")
      D:\Tutorials\Laravel\project\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

  2   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=blog", "homestead", "secret", [])
      D:\Tutorials\Laravel\project\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

This worked for the localhost, but what should I do for homestead?

alter user 'root'@'localhost' identified with mysql_native_password by 'secret';
Feb
25
4 months ago
Activity icon

Started a new Conversation Calling Update Stored Procedure In Laravel 4/ Php5.6

I have been trying to update the database but it is giving me an error after deployment.

  DB::select('call update_users_invoice(' . $invoice_number . ')');

What could be the way to use stored procedure for updating in the older version. The problem arises only when it is deployed.

I am planning to use the below query but not sure it will work after the deployment. I have to sent the files to the manager, he does a deployment. The same issue has been back and forth several times, so I want to make sure this time if it is the way to do.


 DB::select('call update_users_invoice(?)', array($invoice_number));
Feb
20
4 months ago
Activity icon

Started a new Conversation How To Install Composer In Plain Php Project

How to install composer in plain php project?

Feb
19
4 months ago
Activity icon

Replied to SELECT Query For Fetching Data

@sauravs012 used the concepts to write the stored procedure. Thanks @sauravs012

Activity icon

Replied to SELECT Query For Fetching Data

@willvincent There are many other users in users table, Just 5 users are in invoices table. Basically it should select all other users excepts the one in invoice table.

Activity icon

Replied to SELECT Query For Fetching Data

@willvincent I am also doing

SELECT id FROM users 
WHERE NOT EXISTS (SELECT user_id FROM invoices WHERE invoice_date=current_date());

but it is not fetching any data. Data type of invoice_date is date.

Activity icon

Replied to SELECT Query For Fetching Data

@willvincent

DROP PROCEDURE IF EXISTS `get_users_halls`;
delimiter ;;
CREATE PROCEDURE `get_users_halls` ()
BEGIN
SELECT
    u.id , u.email,
    u.first_name,
    u.last_name,
    count(*) as total_halls,
    u.override_membership_price,
    CASE
        WHEN u.override_membership_price IS NULL THEN (((count(*)-1) * 50)+100)*0.1
            ELSE  u.override_membership_price * 0.1
    END AS gst_amount,
    CASE
        WHEN u.override_membership_price IS NULL THEN ((count(*)-1) * 50)+100
            ELSE u.override_membership_price
    END AS total_amount,
    u.subscription,
    u.expires_on,
     CASE
        WHEN u.override_membership_price IS NULL THEN TRUE
            ELSE FALSE
        END AS display_info
    FROM users u
    INNER JOIN halls h ON u.id=h.user_id
WHERE u.expires_on=DATE_ADD(CURRENT_DATE(), INTERVAL 1 MONTH)
AND u.activated=1 AND u.subscription='yearly' group by u.id;
END;
-- CALL `get_users_halls`;

this selects the users but I want to select the data that does not exist in the invoices table. Could you please suggest me how can I write the query in this situation.

Activity icon

Replied to SELECT Query For Fetching Data

Concept: The concept of the job is to send invoices every day but once the email is sent on that day, it should not sent the same email for the same user on the same day. But it should send the email to the same user the next day.

Activity icon

Started a new Conversation SELECT Query For Fetching Data

I have two tables;

  1. users - id
  2. invoices - user_id, invoice_date(current_date), invoice_number

and I have also set up a cron job that calls the query every hour.

I have to write a query/stored procedure that fetches only the data from the users table that doesn't exist in the invoices table on that day.

Eg: If user_id 1 exists on invoices table on 2/19/2020 then, then user_id 1 should not be fetched on that day. but the next day it should fetch the user id, because the current date is not equal to invoice_date of user_id 1.

Feb
18
4 months ago
Activity icon

Replied to Export Data To Excel .csv Without Using Maatwebsite.

public function exportExcel()
    {
        $data = json_decode(json_encode(DB::select('CALL get_users_unpaid_invoices')), True);
        function cleanData(&$str)
        {
            if ($str == 't') $str = 'TRUE';
            if ($str == 'f') $str = 'FALSE';
            if (preg_match("/^0/", $str) || preg_match("/^\+?\d{8,}$/", $str) || preg_match("/^\d{4}.\d{1,2}.\d{1,2}/", $str) || preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$str)) {
                $str = " $str";
            }
            if (strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
        }

        // filename for download
        $filename = "users_unpaid_invoices_" . date('Ymd') . ".csv";

        header("Content-Disposition: attachment; filename=\"$filename\"");
        header("Content-Type: text/csv");

        $out = fopen("php://output", 'w');

        $flag = false;
        foreach ($data as $row) {
            if (!$flag) {
                // display field/column names as first row
                fputcsv($out, array_keys($row), ',', '"');
                $flag = true;
            }
            array_walk($row, __NAMESPACE__ . '\cleanData');
            fputcsv($out, array_values($row), ',', '"');
        }

        fclose($out);
    }
Feb
13
4 months ago
Activity icon

Replied to Call Controller Method In Javascript

@prasadchinwal5

 {{ Form::open(array('url' => 'admin/users/'.$data->id.'/update_invoice', 'method' => 'get')) }}
                                            <button type="submit" class="next small-12 right">Confirm</button>
                                        </form>

but it is redirecting to /update_route. instead I would just like to stay in the same url. This is a modal popup so I don;t want the page to redirect any where else.

Activity icon

Started a new Conversation Call Controller Method In Javascript

method in controller

   public function update_invoice($id)
    {
        return 'success';
    }
    <div id="first-modal" class="reveal-modal" data-reveal>
                                        <h2>Confirmation</h2>
                                        <form>
                                            <button type="submit" class="next small-12 right">Confirm</button>
                                        </form>
                                        <a class="close-reveal-modal">&#215;</a>
                                    </div>
                                    <a class='open-first radius button>Paid</a>
    <script>
        $('a.open-first').on('click', function () {
            $('#first-modal').foundation('reveal', 'open');
        });
        $('a.close').on('click', function () {
            $('#first-modal').foundation('reveal', 'close', {

            });
        });
    </script>

I have to update it in the database, which I will write in the update_incoice function. but I want to call the controller's method in the javascript. How can I call the method?

or

Is there any way to route to the function when the button is clicked.

Feb
12
4 months ago
Activity icon

Started a new Conversation Update The Value Of The Object

 $users = DB::select('CALL get_users_halls');

OUTPUT

[
{
"id": 216,
"email": "[email protected]",
"first_name": "Andree",
"last_name": "Phillips",
"total_halls": 17,
"override_membership_price": null,
"gst_amount": 90,
"total_amount": "900",
"subscription": "yearly",
"expires_on": "2020-03-13",
"display_info": 1,
"invoice_number": null
},
{
"id": 229,
"email": "[email protected]",
"first_name": "Northside",
"last_name": "Community Service",
"total_halls": 3,
"override_membership_price": "1545",
"gst_amount": 154.5,
"total_amount": "1545",
"subscription": "yearly",
"expires_on": "2020-03-13",
"display_info": 0,
"invoice_number": null
}
]

I have to update invoice_number before sending the email using a loop. How can I update invoice_number?

Activity icon

Replied to Update Temporary Table

@fylzero Thank you for helping me. I am still getting Error Code: 1137. Can't reopen table: 'tmp'

UPDATE tmp SET total_halls =(SELECT count(*) 
        FROM tmp t INNER JOIN halls.halls h ON t.id=h.user_id  group by t.id);
Activity icon

Replied to Update Temporary Table

@fylzero SELECT t.id,count(*) as count FROM tmp t INNER JOIN halls.halls h ON t.id=h.user_id group by t.id; gives

id      count
1       22
2       17
3       5

and in tmp table I have the same id but I need to update total_halls with the value fetched by SELECT t.id,count(*) as count FROM tmp t INNER JOIN halls.halls h ON t.id=h.user_id group by t.id;(above is the table).

Feb
11
4 months ago
Activity icon

Started a new Conversation Update Temporary Table

CREATE temporary table tmp (
        id INT ,email VARCHAR(255),
        first_name VARCHAR(255),
        last_name VARCHAR(255),
        total_halls VARCHAR(255),   
        override_membership_price VARCHAR(255),
        total_amount VARCHAR(255),
        gst_amount VARCHAR(255),
        subscription VARCHAR(255),
        expires_on DATE
        ) AS 
        SELECT u.id,u.email,
        u.first_name,
        u.last_name,
        u.expires_on,
        u.subscription,
        u.override_membership_price
        FROM halls.users u  
WHERE u.expires_on=DATE_ADD(CURRENT_DATE(), INTERVAL 1 MONTH) 
AND u.activated=1 AND u.subscription='yearly';

SELECT * FROM tmp t;
    

SELECT t.id,count(*) as count 
        FROM tmp t INNER JOIN halls.halls h ON t.id=h.user_id  group by t.id;

I have to update count fetched SELECT t.id,count(*) as count FROM tmp t INNER JOIN halls.halls h ON t.id=h.user_id group by t.id;. How can I update the tmp table with count(*) ?

Activity icon

Replied to Mysql Query To Fetch Data

@roksprogar thank you so much.

Activity icon

Started a new Conversation Mysql Query To Fetch Data

Example: expires_date=2020-03-12 today_date=2020-02-12

When I execute the script today I have to fetch all the data that has expires_date 1 months from today_date. From the example above, I have to get all the data that has today_date=2020-02-12.

Please help me to write MySQL script.

Activity icon

Replied to Mailgun Webhook

@sinnbeck Thank you so much for your help. I can now update the database using webhooks. Thank you so much. This whole discussion was so important to get the things done. I will write a medium story and share it with you. I would like to share your name too in the article if you don't mind.

Setting hooks without your help was not possible. Thank you so much.

Activity icon

Replied to Mailgun Webhook

@sinnbeck Yes it has been used. I am using ngrok and it show status 200 ok. When the email is sent.

Route::post('webhooks/email_delivered','[email protected]');
 protected $except = [
        'webhooks/*',
    ];
https://9992218b.ngrok.io/api/webhooks/email_delivered

in Delivered Messages

Url is called from the mail gun and it enters the handleDelivered also. Here, I want to update the database. but I cannot see any values in $event_data = $data['event-data'];.

Feb
10
5 months ago
Activity icon

Replied to Mailgun Webhook

@sinnbeck I am following your suggestion and I am getting very close to it. I can see the code being executed but I am failing to get the values to update in the database. Could you please see the code below:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\MailgunWebhook;
use Illuminate\Support\Facades\DB;


class WebhookController extends Controller
{

    public function emailDelivered(Request $request)
    {
        try {
            $this->handleDelivered($request->all());
            return response('Success', 200);
        } catch (Exception $ex) {
            return response($ex->getMessage(), 406);
        }
    }

    public function emailFailed(Request $request)
    {
        $mailgun_webhook = new MailgunWebhook();
        try {
            return $mailgun_webhook->handleFailed($request->all());
            return response('Success', 200);
        } catch (Exception $ex) {
            return response($ex->getMessage(), 406);
        }
    }

    public function handleDelivered(array $data)
    {
        if (!$this->validateWebhook($data['signature'])) {
            throw new \Exception('Invalid signature!');
        }

        $event_data = $data['event-data'];
//        $event_data = $data['user-variables'];
        $delivered_data = [
            'tags' => $event_data['tags'],
            'recipient' => $event_data['recipient'],
            'headers' => $event_data['message']['headers'],
            'timestamp' => $event_data['timestamp'],
        ];
        DB::select('CALL halls.`insert_invoices`(74,"H4H0001",30,"Hello Desc",15,315,"BOM")');
//        $insertDetails = DB::select('CALL insert_invoices(?,?,?,?,?,?,?)', [
//            '216',
//            $event_data['invoiceNumber'],
//            $event_data['term'],
//            $event_data['info'],
//            $event_data['gst_amount'],
//            $event_data['gross_total'],
//            'CommonWealth Bank'
//        ]);
    }

    public function handleFailed(array $data)
    {
        if (!$this->validateWebhook($data['signature'])) {
            throw new \Exception('Invalid signature!');
        }

        $event_data = $data['event-data'];
        $delivered_data = [
            'tags' => $event_data['tags'],
            'recipient' => $event_data['recipient'],
            'headers' => $event_data['message']['headers'],
            'timestamp' => $event_data['timestamp'],
            'delivery_status' => $event_data['delivery-status'],
            'severity' => $event_data['severity'],
        ];
        //return ParseMailFailed::dispatchNow($this->email, $delivered_data);
    }

    public function validateWebhook(array $signature, $api_key = null)
    {
        $timestamp = $signature['timestamp'];
        $token = $signature['token'];
        $signature = $signature['signature'];
        //Concat timestamp and token values
        if (empty($timestamp) || empty($token) || empty($signature)) {
            return false;
        }
        $api_key = $api_key ? $api_key : env('MAILGUN_WEBHOOK');

        $hmac = hash_hmac('sha256', $timestamp . $token, $api_key);
        if (function_exists('hash_equals')) {
            // hash_equals is constant time, but will not be introduced until PHP 5.6
            return hash_equals($hmac, $signature);
        } else {
            return $hmac === $signature;
        }
    }
}

handleDelivered inserts the data because I have provided static values. But I want to insert the data provided from the webhook. so I did

  $insertDetails = DB::select('CALL insert_invoices(?,?,?,?,?,?,?)', [
            '216',//This is for test
            $event_data['invoiceNumber'],
            $event_data['term'],
            $event_data['info'],
            $event_data['gst_amount'],
            $event_data['gross_total'],
            'CommonWealth Bank'
        ]);

to get the value and it is not working. I don't know if it is the correct way to render the value. If I run the hook in webhook interface out database update code. I could only see Response:Success. I dont see any data even if I do return $event_data. How can I update the data in the database?

Feb
09
5 months ago
Activity icon

Awarded Best Reply on How To Send Image As Logo In Mailgun

   'inline' => array(
                    array('filePath' => 'images/sprites/admin/logo.png')),

and in templates I add <img src="cid:logo.png" alt="HallsForHire" srcset="">

and it worked.

I am using template to send an email.

Activity icon

Replied to How To Send Image As Logo In Mailgun

   'inline' => array(
                    array('filePath' => 'images/sprites/admin/logo.png')),

and in templates I add <img src="cid:logo.png" alt="HallsForHire" srcset="">

and it worked.

I am using template to send an email.

Activity icon

Replied to Mailgun Webhook

@sinnbeck Thanks for helping with my queries. I still have some queries. In the function handleDelivered and handleFailed, I can see ParseMailDelivered and ParseMailFailed classes. I want to know how the data is being parsed and dispatched,

Now, I could execute webhooks from mailgun dashboard only when I click "Text Webhook" button. but I was wondering, about executing the hooks when the email is being sent. When my code is sending the email, is the hooks are being executed. How can I debug/check that the hook are working. However, it returns data when I click Text Webhooks from mailgun dashboard.

Feb
07
5 months ago
Activity icon

Replied to Hide/Show Input Field When Form::select Is Selected

@ahkeravi There isn't any error in the console, nothing happens in the change event. And I guess I have added id in

@include( 'admin.partials.form_row', array( 'name'=>"subscription", 'id'=>'subscription','label'=>"Subscription Type", 'input' => Form::select('subscription', Lang::get('users.subscriptions'), (isset($data->subscription) && $data->subscription ? $data->subscription : "")) ) )

but still it only shows name.

Activity icon

Started a new Conversation How To Send Image As Logo In Mailgun

I have to send logo.png in mailgun's template. How can I send image to mailgun template?

Feb
06
5 months ago
Activity icon

Started a new Conversation How To Pass Variables In 'h:X-Mailgun-Variables'

$invoiceNumber = $this->invoiceNumber();
  'h:X-Mailgun-Variables' => '{"title": "$invoiceNumber", "body": "Sending messages with templates"}'

I have to add $invoiceNumber in h:X-Mailgun-Variables but my approach is not working.

 'v:title' => $invoiceNumber,
 'v:body' => 'Sending messages with templates',

This works but not recommended in document.

Activity icon

Started a new Conversation How To Send Templates In Mailgun

I have created a template in blade.php and I have to send the template using mailgun. How can I send invoice template with values using mailgun?

Or is there any method to send a template that accepts a values and send email using mailgun.

Activity icon

Replied to Hide/Show Input Field When Form::select Is Selected

@ahkeravi I don't know why it is not working.

<script>
    $('document').ready(function () {
        $('#subscription').change(function () {
            const data = $(this).val();
            if (data == "yearly") {
                $('#override_membership_price').hide();
            } else {
                $('#override_membership_price').show();
            }
        });
    });
</script>
@include( 'admin.partials.form_row', array( 'name'=>"subscription", 'id'=>'subscription','label'=>"Subscription Type", 'input' => Form::select('subscription', Lang::get('users.subscriptions'), (isset($data->subscription) && $data->subscription ? $data->subscription : "")) ) )


@include( 'admin.partials.form_row', array( 'name'=>"override_membership_price", 'label'=>"Override Membership Price", 'input'=>Form::input('number', 'override_membership_price', (isset($data->override_membership_price) && $data->override_membership_price? $data->override_membership_price : "")) ) )
Activity icon

Replied to Sending 100s Of Email Using Mailgun

@sinnbeck I was trying to setup webhooks but I could not succeed. Could you please suggest me how can I setup webhooks. For now, I am using test emails i.e sandbox. I created html using ngrok and added in event/Action (eg: delivered). After that I don't know what to do, how to get the delivered messages or track the email.

Activity icon

Replied to Sending 100s Of Email Using Mailgun

@sti3bas Thank you for the suggestion. @sinnbeck It is the invoice that I am trying to send and the value differs in each email.

Activity icon

Started a new Conversation Sending 100s Of Email Using Mailgun

I have fetched 2000s email in my database and I have to send email to all the email address. I am thinking to fetch all the email address and using foreach loop I am planning to send the email. Does this method is relevant or is their better way to send emails in such mass email?

Feb
05
5 months ago
Activity icon

Started a new Conversation Add 1 Year In Today's Date Default In Database

How can I add 1 year in today's date default in the database? I am trying to add by doing the following but I feel this is now the correct way because if I just add the year then next year that date would not be present in the calendar. For Eg: 29-Feb-2020 would not be in 2021. So what would be the correct way to add a year ahead date in the database by default.

I just did but this is not the correct way as per my thought

\Carbon\Carbon::now()->addYear()
Activity icon

Replied to Hide/Show Input Field When Form::select Is Selected

<div class="small-9 columns ">
    <select name="subscription">
        <option value="yearly">Annual</option>
        <option value="percentage">Percentage</option>
    </select>                               
</div>

<div class="small-9 columns ">
    <input name="override_membership_price" type="number" value="">                 
</div>

<script>
    $('document').ready(function () {
        $("#subscription").change(function(){
            alert("Hello");
        });
    });
</script>

@shez1983 this is the html generated.

Feb
04
5 months ago
Activity icon

Started a new Conversation Hide/Show Input Field When Form::select Is Selected

<?php 

return array(

    'subscriptions' => array(
        'yearly' => 'Annual',
        'percentage' => 'Percentage',
    ),

);
@include( 'admin.partials.form_row', array( 'name'=>"subscription", 'id'=>'subscription','label'=>"Subscription Type", 'input' => Form::select('subscription', Lang::get('users.subscriptions'), (isset($data->subscription) && $data->subscription ? $data->subscription : "")) ) )


@include( 'admin.partials.form_row', array( 'name'=>"override_membership_price", 'label'=>"Override Membership Price", 'input'=>Form::input('number', 'override_membership_price', (isset($data->override_membership_price) && $data->override_membership_price? $data->override_membership_price : "")) ) )

How can I hide or show override_membership_price when user change "subscription" value to "Annual".

I am trying to do like :

<script>
    $('document').ready(function () {
        $("#subscription").change(function(){
            alert("Hello");
        });
    });
</script>

I don't know why it is not working. Please help me.

Feb
03
5 months ago
Activity icon

Replied to [caching_sha2_password] Error When Running Php Artisan Migrate

alter user 'username'@'localhost' identified with mysql_native_password by 'password';

Example:: alter user 'root'@'localhost' identified with mysql_native_password by 'password123'

https://github.com/laradock/laradock/issues/1390?fbclid=IwAR0Y0EEWc6-yoCv1Yey2D3WidFOHfGaWXA2o9o0C-OWW6QgxVL1kNID4JUQ#issuecomment-419562297

but I was wondering, what happens with homestead? If anyone has tried please share.

Activity icon

Replied to Mailgun Webhook

@bobbybouwmann I have done the setup and was able to send the emails using a sandbox user. Now I want to track the emails. If it is delivered, open. So I was trying to configure the webhook but I could not do it.

Feb
02
5 months ago
Activity icon

Started a new Conversation Mailgun Webhook

Can anyone provide mailgun webhook setup document with test domain? i.e sandboxxxxxx.mailgun.org. I have been following mailgun documents but it is getting very difficult for me to understand the docs and setup. if anyone could provide step by step mailgun webhook setup process than it would be a great help.

Jan
31
5 months ago
Activity icon

Replied to Sending Emails With Mailgun

How can I add CNAME ?

Jan
30
5 months ago
Activity icon

Started a new Conversation Create Automatic Invoice For Membership Renewal

Create an automatic invoice for membership renewal - invoice to be sent via email 1 month prior to the membership renewal date and a reminder each month until paid.

How can I implement these features? Which library do I need to use? Please suggest.

Activity icon

Started a new Conversation Export Data To Excel .csv Without Using Maatwebsite.

How can I export data to excel .csv file without using maatwebsite.

I have to add export features to the existing project created in Laravel 4. I did it using maatwebsite, but the problem is when I deploy it to prod, it is not accepted. Shows an error with maatwebsite and when I remove it and deploy everything works. I don't what is the issue but I am also thinking of other ways to export the data. If there is any other way to export data. Is there any other way to work with it.