jonjie

Software Developer at Laguna

Experience

11,340

0 Best Reply Awards

  • Member Since 11 Months Ago
  • 97 Lessons Completed
  • 0 Favorites

20th September, 2018

jonjie left a reply on How To Use Queue Using Database As Driver • 3 weeks ago

Thanks @Mithrandir :)

jonjie left a reply on How To Use Queue Using Database As Driver • 3 weeks ago

Uhm .. May I ask what driver you're using personally? And may I ask why? Sorry for a lot of follow up questions :)

jonjie left a reply on How To Use Queue Using Database As Driver • 3 weeks ago

Alright, nice. Is redis free? any tutorials for redis + laravel email?

jonjie left a reply on How To Use Queue Using Database As Driver • 3 weeks ago

@Mithrandir . Any downside using database as queue driver?

jonjie left a reply on How To Use Queue Using Database As Driver • 3 weeks ago

Thanks for the answer Mithrandir. For #2., It's database driver specifically.

19th September, 2018

jonjie started a new conversation How To Use Queue Using Database As Driver • 4 weeks ago

I have some questions regarding queues in laravel.

  1. Is it fine to use database as driver for email queuing in live site?
  2. Do you know some tutorials for this?

Note: I'm using laravel v5.1 for this.

18th September, 2018

jonjie left a reply on Free And Best Practice For Sending Bulk Email Messages? • 4 weeks ago

Alright. I get it. Thanks for your help @MikeRees and @Cronix :)

jonjie left a reply on Free And Best Practice For Sending Bulk Email Messages? • 4 weeks ago

Hi @MikeRees . It means if I have 333 users, and send daily email, I can only send 1 email per day for the 333 users?

jonjie started a new conversation Free And Best Practice For Sending Bulk Email Messages? • 4 weeks ago

Any suggestion for best practice on how to send email and free as well? I've read this post: https://laracasts.com/discuss/channels/laravel/best-practice-for-mass-group-emailing?page=1 regarding the best practice but I think I have to use some kind of third party to make it possible. Do you have any recommendation about this without any extra fees?

17th September, 2018

jonjie left a reply on Validation Under Array Validation • 1 month ago

@NOMGUY . Hi, any explanation?

jonjie left a reply on Validation Under Array Validation • 1 month ago

Hi @tykus . I think this won't work. I'm using laravel 5.1 version.

jonjie started a new conversation Validation Under Array Validation • 1 month ago

If I have an array validation rule, how can I check if all the items in the array is a valid email. I'm using this: https://laravel.com/docs/5.1/validation#rule-array for the array validation rule.

$this->validate($request, [
    'email' => 'required|array'
]);

12th September, 2018

jonjie started a new conversation No Returned Phone Number In PayPal API • 1 month ago

I checked the data return from paypal using dd() in laravel, but there is no phone number listed there. How can I get that data?

I'm using this package: https://github.com/paypal/PayPal-PHP-SDK

Please look at this StackOverflow link for more details: https://stackoverflow.com/questions/52196026/no-returned-phone-number-in-paypal-api

4th September, 2018

jonjie left a reply on Login Will Not Log User In Although All Credentials Are Correct. • 1 month ago

Have you try this one?

use Illuminate\Contracts\Auth\Authenticatable

class User extends Authenticatable implements Authenticatable{

jonjie left a reply on How To Check If Uploaded Image Has A Watermark? • 1 month ago

I think there's no solution with this. Since it is on front end part, though there is something around the internet to use, you cannot check if it is 100% accurate. @Cronix is correct.

jonjie left a reply on Other Way On Logging Out Specific User? • 1 month ago

I think Auth is using session. So, you cannot do that, unless add some field in your users table.

3rd July, 2018

jonjie started a new conversation PayPal API With Laravel - Getting The Data • 3 months ago

I'm trying to implement the API of paypal payment with laravel 5.1. But when I login in paypal (sandbox), it uses the address I used in my account, and also it uses the name from paypal account not the data from my website. That's my problem.

I want to use the data from my website because it doesn't make sense if I enter the shipping address (for example) from my website and not using it. Please see my code below for reference (Or comment down below for some details from me).

class PaypalPaymentController extends BaseController
{

    private $_api_context;

    public function __construct(){
        $paypal_conf = \Config::get('paypal');

        $this->_api_context = new ApiContext(new OAuthTokenCredential(
            $paypal_conf['client_id'],
            $paypal_conf['secret']
        ));

        $this->_api_context->setConfig($paypal_conf['settings']);
    }

    public function payWithPaypal(Request $request){
        $payer = new Payer;
        $payer->setPaymentMethod('paypal');

        $price = 0;

        switch($request->get('amount')) {
            case '10 books':
                $price = 6200;
                break;
            case '20 books':
                $price = 12200;
                break;
            case '50 books':
                $price = 25200;
                break;
            default:
                return redirect()
                        ->route('bookstore.shipping')
                        ->with('danger', 'Please select the right amount of book/s.');
                break;
        }

        $item1 = new Item();
        $item1->setName($request->get('amount'))
                ->setCurrency('PHP')
                ->setQuantity(1)
                ->setPrice($price);

        $item_list = new ItemList();
        $item_list->setItems([$item1]);

        $amount = new Amount();
        $amount->setCurrency('PHP')
                ->setTotal($price);

        $transaction = new Transaction();
        $transaction->setAmount($amount)
                    ->setItemList($item_list)
                    ->setDescription('Books transaction');

        $redirect_urls = new RedirectUrls();
        $redirect_urls->setReturnUrl(route('bookstore.payment-status'))
                        ->setCancelUrl(route('bookstore.payment-status'));

        $payment = new Payment();
        $payment->setIntent('Sale')
                ->setPayer($payer)
                ->setRedirectUrls($redirect_urls)
                ->setTransactions([$transaction]);

        try{
            $payment->create($this->_api_context);
        } catch(\Palpal\Exception\PPConnectionException $e){
            if(\Config::get('app.debug')){
                return redirect()
                        ->route('bookstore.shipping')
                        ->with('danger', 'Connection Timeout.');
            }

            return redirect()
                    ->route('bookstore.shipping')
                    ->with('danger', 'Some error occured, sorry for the inconvenience.');
        }

        foreach($payment->getLinks() as $link){
            if($link->getRel() == 'approval_url'){
                $redirect_url = $link->getHref();
                break;
            }
        }

        Session::put('paypal_payment_id', $payment->getId());

        if(isset($redirect_url)){
            return Redirect::away($redirect_url);
        }

        return redirect()
                ->route('bookstore.shipping')
                ->with('danger', 'Unknown error occured.');
    }

    public function getPaymentStatus(){
        $payment_id = Session::get('paypal_payment_id');
        Session::forget('paypal_payment_id');

        if(empty(Input::get('PayerID')) || empty(Input::get('token'))){
            return redirect()
                    ->route('bookstore.shipping')
                    ->with('danger', 'Payment failed.');
        }

        $payment = Payment::get($payment_id, $this->_api_context);
        $execution = new PaymentExecution();
        $execution->setPayerId(Input::get('PayerID'));

        $result = $payment->execute($execution, $this->_api_context);

        if($result->getState() == 'approved'){
            // Send Email
            $email_data = [
                'number_of_books' => $payment->transactions[0]->item_list->items[0]->name,
                'shipping' => [
                    'street' => $payment->payer->payer_info->shipping_address->line1,
                    'city' => $payment->payer->payer_info->shipping_address->city,
                    'state' => $payment->payer->payer_info->shipping_address->state,
                    'country' => $payment->payer->payer_info->shipping_address->country_code,
                ]
            ];

            // Send email function here ...

            return redirect()
                    ->route('bookstore.shipping')
                    ->with('success', 'Transaction payment success!');
        }

        return redirect()
                ->route('bookstore.shipping')
                ->with('danger', 'Payment failed.');
    }

}

25th June, 2018

jonjie left a reply on Redirect Back To Website After Payment In Paypal • 3 months ago

Hi @Yorki. Do you have another way to do this? Coz if I used this package, I'm gonna require a confidential infos. Thanks

jonjie left a reply on Redirect Back To Website After Payment In Paypal • 3 months ago

Hi @Yorki . Thanks for your reply. Uhmm, I don't know how to use it. The documentation is very general. Do you have any specific tutorial for this? Thanks again.

jonjie started a new conversation Redirect Back To Website After Payment In Paypal • 3 months ago

Hello. How can I redirect the user back to my website after the payment in paypal? so I can send an email and display a success message to the user. I'm using laravel v5.1 here. Thanks a lot.

20th June, 2018

jonjie left a reply on How To Determine A Framework? • 3 months ago

@Nash I'm still confused with this.

jonjie started a new conversation How To Determine A Framework? • 3 months ago

Hi guys. I've searched over the internet but I didn't get the right one. I just want to ask how can I determine if something (PHP or JS) is a framework or a library. I'm really confused. For example, jQuery, some say that this is a framework, and some are not. Also VueJS, I think it is a library, but in documentation, it says it is a framework. I'm really really confused. Thanks.

11th June, 2018

jonjie left a reply on Podcast Download • 4 months ago

@Snapey Thanks for the link :)

jonjie left a reply on Podcast Download • 4 months ago

@Resin I also know this trick, but is it okay to download it like that? I mean, is it legit? Thanks.

jonjie started a new conversation Podcast Download • 4 months ago

I know I can download a video from the series. But, I also want to download podcasts so I can still listen to it even if I'm offline. Can I download a podcast? And since the list is not yet that super bulky, how can download it all at once? Thanks a lot.

29th May, 2018

jonjie started a new conversation Why Do We Need Other Package To Test? • 4 months ago

Hi. I'm just thinking why do we really need to use other packages like PHPUnit to test our application? Why not just using the application on how users use it? Like for example if we have a registration functionality, why not just test it by just using the application itself? Sorry but I'm really confused about it. I also read this https://softwareengineering.stackexchange.com/questions/116076/why-use-phpunit-when-traditional-manual-testing-can-be-used, but still confusing.

28th May, 2018

jonjie left a reply on Cannot Modify Country In Paypal • 4 months ago

Yeah, thank man, co'z I don't have a telephone to call them. I think that's the only way to contact them; they don't have a chat support, only contact numbers.

jonjie left a reply on Cannot Modify Country In Paypal • 4 months ago

It didn't work with the <fieldname>. Other fields are working except the country.

jonjie started a new conversation Cannot Modify Country In Paypal • 4 months ago

Hi. I'm implementing a paypal payment in my website but the country is not changing when I'm checking out. Please see my code below:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <input type="hidden" name="cmd" value="_s-xclick">

    <div class="form-group">
        <input type="hidden" name="address_override" value="1">
        <input type="hidden" name="address1" value="Shipping Address">
        <input type="hidden" name="address2" value="Building name and office number">


        <input type="hidden" name="city" value="Tokyo">
        <input type="hidden" name="zip" value="2024">
        <input type="hidden" name="country" value="JP">
    </div>
</form>

23rd May, 2018

jonjie left a reply on Where Function In BelongsToMany Problem • 4 months ago

Have you try to use just Node::with('tags')->paginate(12); ?

22nd May, 2018

jonjie left a reply on Namespace Hierarchy In PHP • 4 months ago

@Cronix Haha Great. Very nice and simple exaplanation. I gonna order it from shortest too so it will be cute haha

jonjie started a new conversation Namespace Hierarchy In PHP • 4 months ago

Is there any issue or conflict about the hierarchy of using namespace? I mean if I have 5 imported class, should I have to arrange them? Or is it not necessary?

Is there anything to consider with the example below? Or is there any different? How about in terms of best practices?

Example:

use App\User; use App\UserProfile; use App\Post; use App\Comments;

VS

use App\Post; use App\User; use App\UserProfile; use App\Comments;

16th May, 2018

jonjie left a reply on Why Bootstrap 4? • 5 months ago

Hi @topvillas . Aside from they don't support IE9 and below and iOS 6 and below, why do you think we don't need to use bootstrap 4?

jonjie started a new conversation Why Bootstrap 4? • 5 months ago

Hi guys. I know laracasts has many awesome developers that can answer this question so I decided to asked it here. So ... yah, why do you think we need to use bootstrap 4?

27th April, 2018

jonjie left a reply on Laravel Is A Giant Waste Of Time • 5 months ago

Haha! Two years ago from now, but hey. You know what, Laravel is so worth it to learn. Once you get it, you're just like driving a car using your imagination, where you can go anywhere you want ;)

jonjie left a reply on Where Are You All From? • 5 months ago

Laguna, Philippines :)

16th April, 2018

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

Great! I'll try it now. Please wait for my response about the result. Thanks a lot!

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

Hi @Cronix . Thanks. One more thing, is it possible to use [email protected] even if I set the .env file to [email protected]? I mean with different domains? Thanks again.

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

Hi @Cronix . Thanks for your answer. However, if I use [email protected] in .env file and [email protected] in my controller, will this work? Also, is that artisan config:clear or php artisan config:clear? I've read some of the questions about this command, and some say that after they run the command, their system brokes or getting errors.

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

Hi @bobbybouwmann . MAIL_FROM_ADDRESS is not available in .env file. BTW I'm using laravel v5.1. And what if I have a different form and I want the from to be different, is that possible?

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

I noticed that the from when you received the email is the username in .env file. What if I have a different form and I want it to have a different from?

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

I've also tried to edit the mail.php in config folder but still the same

jonjie left a reply on Mail From Not Displaying The Correct Email • 6 months ago

Hi @bobbybouwmann .. Thanks for your reply. But, Yes, I'm really sure.

jonjie started a new conversation Mail From Not Displaying The Correct Email • 6 months ago

Hi Guys. I've setup my .env file with a different email from using Mail::send(), so basically, What I have is:

.env

[email protected]

EvaluationController

Mail::send(...., function($m){
    $m->from('[email protected]', 'jonjie');
});

But the email displaying is still the gmail one. Why is that? How can I solve it?

11th April, 2018

jonjie left a reply on Pagination Doesn't Works • 6 months ago

Try this:

$search_results = MagazineSubcategory::whereHas('products', function ($query) {
            return $query->where('name', 'wiertarki');
        })->orderBy('id', 'desc')->paginate($liczba_paginacji);

10th April, 2018

jonjie left a reply on Pagination Doesn't Works • 6 months ago

When I saw your code:

 @foreach($search_results as $search_result)
                                @foreach ($search_result->products as $result)
                                Extracting data...
                                @endforeach
                            @endforeach
{{ $search_results->links() }}

I'm expecting the you're displaying the products. Have you tried this code?

 @foreach($search_results as $search_result)
     // Extracting data ...
 @endforeach
{{ $search_results->render() }}

27th March, 2018

jonjie started a new conversation How To Setup Gulp For Testing In PHP? • 6 months ago

Hi guys. How can I setup Gulp for the PHP testing that Jeff's uses here on his tutorial so I can just save the file then the pop up appears:

https://laracasts.com/series/code-katas-in-php/episodes/1

Thanks!

22nd March, 2018

jonjie left a reply on Port 80 Getting Added To URLs After POST • 6 months ago

Hi @WallyJ .. have you tried to add a name to your route? and use it instead?

19th March, 2018

jonjie left a reply on Port 80 Getting Added To URLs After POST • 6 months ago

Hi @WallyJ .. Can we see your route for the post?

jonjie left a reply on Check If An Email Was Sent • 6 months ago

Hi @bashy . Can you link the Mail::failures() method here? Thanks

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.