Jonjie

Jonjie

Back end Developer at Philippines

Member Since 2 Years Ago

Experience Points
15,830
Total
Experience

4,170 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
124
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 4
15,830 XP
Mar
31
1 day ago
Activity icon

Started a new Conversation How To Get Current Location As Text Using Google Map And Laravel

How to get current location as text using google map and laravel?

I just want the text format of the current location.

I tried this link with the provided example but It's indicated how to get the exact location as text.

https://developers.google.com/maps/documentation/javascript/geolocation

JSFiddle: https://jsfiddle.net/8xnawk3t/

Any Idea?

Mar
20
1 week ago
Activity icon

Replied to Setup In Ubuntu Only Shows Index.php As Text

@siangboon No. It really showing the php code. no error is showing.

Activity icon

Replied to Setup In Ubuntu Only Shows Index.php As Text

@camilovietnam what do you mean by version 6.0?

Activity icon

Replied to Setup In Ubuntu Only Shows Index.php As Text

@maverickchan I'll try your suggestion. thanks

Mar
19
1 week ago
Activity icon

Started a new Conversation Setup In Ubuntu Only Shows Index.php As Text

Hi. I'm trying to setup my laravel app to my ubuntu machine. I've already enabled the mod_rewrite but still not working.

Problem: When visiting the url, it only shows the index.php file as text.

Any idea about this?

vhosts.conf

<VirtualHost *:80>

        ServerAdmin [email protected]
        DocumentRoot /var/www/laravel55/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/laravel55>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Server: apache2

Laravel version: 5.5

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^ [N]

    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/ 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ server.php
	
	RewriteCond %{HTTP:Authorization} ^(.*)
	RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>
Mar
05
3 weeks ago
Activity icon

Commented on Node, Redis, And Socket.io

Is it really necessary to run the command in console whenever we use real-time applications?

Feb
11
1 month ago
Activity icon

Replied to How Do You Apply SOLID Principle In Laravel?

@tisuchi Thank you very much. Really appreciate it:)

Feb
10
1 month ago
Activity icon

Replied to How Do You Apply SOLID Principle In Laravel?

@tisuchi I like the repo you've created. But maybe if you have implemented the SOLID inside of Laravel is better so I can see or follow the code on how you used it.

Feb
09
1 month ago
Activity icon

Replied to How Do You Apply SOLID Principle In Laravel?

Hi @tisuchi. Thanks for the resources, however, if you have any example code (maybe from github), please share it to me so I can check the code on how they follow or apply SOLID inside of Laravel app :)

P.S. I already read/watched some of the SOLID principle tutorials including Jeffs.

Feb
08
1 month ago
Activity icon

Started a new Conversation How Do You Apply SOLID Principle In Laravel?

Hey guys.

Just curious, how do you apply SOLID principle in laravel? I mean, can you give a full example of applying the principle? Like, how do you apply the Single responsibility since you have to work in your controller? Isn't it bad to make your controller fatty? and how do you apply the Open/close? and the rest of the SOLID?

Feb
04
1 month ago
Activity icon

Replied to FaceBook Modal Is Not Coming Up In Laravel Home Page

Hi @mvd. Thanks for linking Magnific Popup. This is exactly what I'm looking for for my project.

Dec
09
3 months ago
Activity icon

Replied to How To Work With Database For Subscription

@mvd Thanks bro, I get the idea.

Activity icon

Replied to How To Work With Database For Subscription

@tisuchi Thanks bro, but I'm using PayPal for the subscription. And this subscription is per class, not per person.

Activity icon

Replied to How To Work With Database For Subscription

@mvd Do you have any documentation for this?

Dec
08
3 months ago
Activity icon

Started a new Conversation How To Work With Database For Subscription

Hi guys. I'm currently developing a functionality where the user can subscribe to a specific class for a school. Now, what I'm confusing with, is the database structure because I'm thinking how can I add the functionality if the user wants to extend the subscription. Please see my database structure below.

If the user still have time for the subscription and wants to extend, the time should be added in subscription_ends_at field.

Or maybe I should use another table for subscription extension?

Nov
27
4 months ago
Activity icon

Replied to Timezone Matters For Subscription Time?

Thanks for your thoughts @siangboon :) I am thinking how Jeffrey handles subscription expiry dates for his users. Uhm

Activity icon

Replied to Timezone Matters For Subscription Time?

Hi @tisuchi. I already have subscription_ends_at and subscribed_at field in the database. May I know what do you prefer from the 2 options you gave, and why?

Activity icon

Started a new Conversation Timezone Matters For Subscription Time?

Hey guys! Just thinking if timezone matters for the subscription time of the users?

If the user subscribed in the US at November 27, 2019 09:56:52, what would be the result if the server is in ASIA? Is it 2019-11-27 09:56:52? or different?

BTW, I'm using Laravel v5.1.

Nov
26
4 months ago
Activity icon

Commented on Step 1: Get PHP Installed

You probably need to take some rest. And then while doing that, listen to this podcast by Jeff.

Nov
19
4 months ago
Activity icon

Replied to Account Subscription With Existing Data

@cronix Okay then. Do you also have an idea on how can I notify the user using email when their subscription expires without user interaction?

Nov
17
4 months ago
Activity icon

Replied to Account Subscription With Existing Data

@cronix What if I want to switch with PayPal?

Activity icon

Started a new Conversation Account Subscription With Existing Data

Hi. I'm currently planning to add subscriptions for my class that I have created; like laracasts where you can add a subscription to your account to access all the content. But the difference is, for me, YOU NEED TO SUBSCRIBE TO EACH CLASS TO HAVE ACCESS. Now, my problem is, I currently have classes created and don't know how to add the subscription part.

I'm gonna use PayPal/Stripe for the payment, By the way.

Laravel version: v5.1

Thanks a lot in advance.

Oct
24
5 months ago
Activity icon

Replied to Call To Undefined Function Collect()

I got it now.

Solution:

import the class like so: use Illuminate\Support\Collection;, and then,

(new Collection(Input::get('size')))->chunk(4);
Activity icon

Replied to Call To Undefined Function Collect()

@nakov uhm. But the api have this Collection class. Can we use it to get the exact resutl of collect() helper?

API: https://laravel.com/api/4.2/Illuminate/Support/Collection.html

Activity icon

Started a new Conversation Call To Undefined Function Collect()

I got this error when I tried to use the helper function collect().

collect(Input::get('size'))->chunk(4);

I'm using laravel 4.2 version.

Activity icon

Replied to Saving Parents With Their Items

@tykus Would this continue with the next parent? I mean, chunk(4) getting the first 4; would this continue with the next 4 children?

... And, I got an error:

Call to undefined function collect()

Activity icon

Replied to Saving Parents With Their Items

@tykus By the way, I'm using laravel 4.2 version.

Activity icon

Replied to Saving Parents With Their Items

@tykus How about this one that you wrote a while ago?

$parents = Input::get('items');
$children = collect(Input::get('sizes'))
    ->chunk(4)
    ->each(function ($chunk, $index) use ($parents) {
        $parent = Parent::create(['preperty' => $parents[$index]]); // replace 'property' with attribute
        $chunk->each(function ($child) use ($parent) {
            $parent->children()->create([ /* attributes on $child */ ]);
        });
    });

Would this continue with the next parent? I mean, chunk(4) getting the first 4; would this continue with the next 4 children?

Activity icon

Replied to Saving Parents With Their Items

@tykus What would be the next step after this markup?

BTW, all the rows will be generated using javascript. I didn't loop it.

Activity icon

Replied to Saving Parents With Their Items

@tykus Please see the screenshot below.

Activity icon

Replied to Saving Parents With Their Items

@tykus Nice and really bright idea. But, what if the second parent has only 3 children?

Activity icon

Started a new Conversation Saving Parents With Their Items

How can I save the items according to their specified parent data? Please see the screenshot below and code.

Screenshot:

Pseudo Code:


$parents = Input::get('items');
$children = Input::get('sizes');

foreach($parents as $parent){
    Parent::create([]);

    foreach($children as $child){
        Child::create([data here with parent id]);
    }
}

... But obviously, with that code, all children will only be saved for the first parent data since it will loop all the child data.

Example of output data when returning with Response::json();:

{"item": ["Item1", "Item2"],
"type": ["block", "plain"],
"quantity": ["75", "302"],
"equivalent": ["1", "1", "1", "1", "4", "20", "0", "4"],
"quantity": ["1", "2", "3", "4", "5", "6", "7", "8"]}

Laravel version: 4.2

Oct
16
5 months ago
Activity icon

Replied to Validation In Laravel

uhm is there any difference with your answers @bobbybouwmann and @sinnbeck ?

Activity icon

Started a new Conversation Validation In Laravel

I just want to add the operators for the validation using regex in laravel. Please see my code below.

$this->validate($request, [
    'formula' => 'regex:/^[0-9]+$/'
]);

How can I also allow operators; +, -, *, and /?

Oct
15
5 months ago
Activity icon

Replied to Can't Get Migration To Work ?

I know this is a late answer, but probably this would solve your issue.

  1. Go to app/storage/migrations.
  2. Delete the migration file that causes the error (You can also delete everything stored there).
  3. Done.
Oct
07
5 months ago
Activity icon

Replied to View Render Returns Undefined Variable

@sti3bas @jaytee @nakov @munazzil @resin @tanveerkhanwd Please see my updates above guys. Thank you very much.

Activity icon

Replied to View Render Returns Undefined Variable

@resin No. Still the same hash. uhm

Activity icon

Replied to View Render Returns Undefined Variable

@munazzil I have middleware auth in my routes.php like so:

Route::get('user/edit', ['middleware' => ['auth']]);

Activity icon

Replied to View Render Returns Undefined Variable

@nakov Nothing's changed.

Activity icon

Replied to View Render Returns Undefined Variable

@sti3bas

33: ...
34: <h1>{{ $user->username }}</h1>
35: ...
Activity icon

Replied to View Render Returns Undefined Variable

@jaytee No. I want it to return as a string, as well as I can pass a variable to it because I don't want to return a very long html code.

Activity icon

Replied to View Render Returns Undefined Variable

@sti3bas

ErrorException in b3cba3bc6b8a0eda0f3a3623998c8672 line 34: Undefined variable: user
Activity icon

Replied to View Render Returns Undefined Variable

@sti3bas Sorry I forgot to add that. Yes, it is before the view. Please see the update.

Activity icon

Started a new Conversation View Render Returns Undefined Variable

I'm trying to return a specific view's content, but it returns an undefined variable error. Please see my code below:

getEditUser() method in UserController:

$user = auth()->user();
$html = view('users.edit', compact('user'))->render();
return $html;

routes.php

Route::get('user-edit', [
        'as' => 'user.edit',
        'uses' => '[email protected]',
        'middleware' => ['auth']
    ]);

edit view (Not full code, but the rest of code is just pure html. Just rubbish code.)

33: ...
34: <h1>{{ $user->username }}</h1>
35: ...

Any idea?

P.S. I know how to return a view. But what I want is to return the content of the view as html and also able to access a variable. I also tried php artisan view:clear but still no luck.