siangboon

siangboon

Developer at Kuala Lumpur, Malaysia

Member Since 4 Years Ago

Kuala Lumpur

Experience Points
229,270
Total
Experience

730 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
1586
Lessons
Completed
Best Reply Awards
91
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 46
229,270 XP
Sep
18
3 days ago
Activity icon

Replied to Zsh: Command Not Found: Laravel

have you installed php???

Activity icon

Replied to Redirecting When Your User Screws Up The URL Address

Suppose when install laravel and scaffold auth, it will generate this route in web.php

Auth::routes();

Inside this, it included the named route "login" unless you had remove or have some other route overriding…

Snappy was suggesting 'Route::redirect('/',route('login'));' so user hit the '/' will redirect to the route with name 'login', Your Route::redirect('/',route('KidsClub.test/login')) is suggesting user visit '/' will redirect to route named "KidsClub.test/login" which does not seem you have defined it and it's not a proper naming also…

Btw, do not use capital case for URL, in some system may hit issue…

Sep
17
4 days ago
Activity icon

Replied to Displaying Wrong

Did the file naming missing or misspelled ".blade"?

Activity icon

Replied to The Requested Resource File.pdf Was Not Found On This Server.

Double check your form again whether any.error, such as the path, method, or missing enctype="multipart/form-data"…

Sep
16
5 days ago
Activity icon

Replied to How Move Laravel Project To Demo Folder

you do not need to move any files but just change the route web.php, group all the route list and add the prefix...

https://laravel.com/docs/8.x/routing#route-groups

Activity icon

Replied to How Move Laravel Project To Demo Folder

i think the simple way is to group all the route and add a prefix for it

Route::prefix('/demo/')->group(function () {
... // all your route here...
});

Activity icon

Replied to How Can Get Last 10 Character Of String From Database

->select(DB::raw('RIGHT(column_name,10)'))
Activity icon

Replied to Need Suggestion For Server Configuration

I think Laracasts is still using Vimeo...

Activity icon

Replied to Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\Exports\IncomeExpenseReportExport3' Not Found

you may check the typo error including the case sensitive for both namespace and class name...

Activity icon

Replied to Laravel Mail

i think it just mean the encryption process of the package had been completed. It may not related to your errors/issue not sending out....

Sep
15
6 days ago
Activity icon

Awarded Best Reply on Local To UTC And UTC To Local Conversion

perhaps, configure your database timezone accordingly, use the Carbon timezone api to display according to user respectively.

https://carbon.nesbot.com/docs/#api-timezone

Sep
14
1 week ago
Activity icon

Replied to Cloudflare Alternatives

You should able to access your site with IP Address of your site...

I'm not sure whether we are at the same page, I meant this Linode login page "https://login.linode.com/" should have nothing to do with your Cloudflare setting...

Activity icon

Replied to What Makes It Ok For Linux To Have 200+ Line Methods?

I don't think that is right to compare like that.... kernel is core and operation system and it involve a lot of stuffs which more than what you can imagine like application system...

In the application we building, we are focus on the functionalities of the application only, and there are a lot libraries and frameworks and even plugins to be used and the OS already built the foundation such as the display, inputs even the browse for us to work respectively, so we can easily split it into small module... but in lower level language it can't be easily split out, as a lot of task need to be triggered simultaneously....

I'm not so sure what the functions are inside the code shown, but it clearly show that the junk of codes already split into many functions, some of them are related and some may seem not related to each others...

I think neither the 100 lines nor 20 lines are always right for all application, it is just a suggestion and references... if you apply to assembly language it is totally insane....

Activity icon

Replied to How Do You Make Only This User Can View The Page

basically you can use the flag to do the checking on both controller (back-end) and blade file (front-end).... however, it may be easier and flexible to use the policy to manage it....

Sep
13
1 week ago
Activity icon

Replied to Permission Denied

check you laravel and system log, i didn't see there is a permission checking on search... i guess that it may whether the setup issue or folder permission issue...

Activity icon

Replied to It's Laracast YouTube Channel Dead?

i think the reason he uploaded the videos there is just to lead some new learners from youtube to Laracasts.... and even if one day he suddenly upload videos there again, all the contents will not be latest as in Laracasts...

Activity icon

Replied to Cloudflare Alternatives

from my experience, Cloudflare is quite reliable and stable even for the free plan also, perhaps you can try send email to the support to find out the issue... if your site is very critical, you can sign up their business plan which provide 100% uptime SLA....

btw, i'm not so sure why login to the linode related to cloudflare (would it be your site down due to linode service down?) , btw, you can by pass Cloudflare proxy for certain ip addresses also...

Activity icon

Replied to Permission Denied

Did you hit any error while setting up the project?? I did encountered few errors while composer install and run the migration due to some extension and deprecated package... and fixed it and re-setup again and work fine...

Sep
12
1 week ago
Activity icon

Replied to What Do You Think About Laravel 8

few latest series in laracasts are covering Tailwind, and i saw there were a lot of copy and paste classes for every single elements.... make me less interests to practice the lessons.... hahaha...

the one thing i dislike the most is... by the time i finish the project, most likely the version bug/secuirty fixes are no longer supported..... hahahaha.....

Activity icon

Replied to Php Artisan Migrate Ran Successfully But Doe Not Create Tables

i guess you may have multiple db instances in your system....

Activity icon

Awarded Best Reply on Can't Login In To Admin Account

if it does not hit the controller, check the action "link" and method whether correct, if it hit the controller, then you can try to dd() something in each before and after action to identify where the error occurred.

however, i think you should include the display $errors in your blade, as it may because error due the validation failed...

Activity icon

Replied to Can't Login In To Admin Account

if it does not hit the controller, check the action "link" and method whether correct, if it hit the controller, then you can try to dd() something in each before and after action to identify where the error occurred.

however, i think you should include the display $errors in your blade, as it may because error due the validation failed...

Activity icon

Replied to Base Table Or View Not Found: 1146 Table 'i-v.admins' Doesn't Exist

did you restart the tinker after migration?

Activity icon

Replied to Local To UTC And UTC To Local Conversion

perhaps, configure your database timezone accordingly, use the Carbon timezone api to display according to user respectively.

https://carbon.nesbot.com/docs/#api-timezone

Sep
11
1 week ago
Activity icon

Awarded Best Reply on Target Class [Admin\LoginController] Does Not Exist

are you copying version 7 route to version 8???

try

'App\Http\Controllers\Admin\[email protected]'
...
Activity icon

Replied to Laravel If Else Doesn't Work

i guess that there may be typo error or tag does not closed / nested properly....

re-indent all the code and comment/uncomment the block of collapses part by part to test it out...

Sep
10
1 week ago
Activity icon

Replied to Target Class [Admin\LoginController] Does Not Exist

are you copying version 7 route to version 8???

try

'App\Http\Controllers\Admin\[email protected]'
...
Activity icon

Replied to Routes Not Working On The Server But Works Well On The Localhost

common reasons are .htacess is not configure properly or case sensitivity... show more info will be helpful for other to help you...

Activity icon

Replied to Best Way To Rename "Teams" For "Projects" With Jetstream

why not leave the teams as it is and duplicate the code or create your own??? use the teams as the reference since you like it so...

modifying source code may be more hustle especially when version upgrade...

Activity icon

Replied to Make:auth ?

hahaha, since few of you are complaining, i also want to hijack and complain (since there is no better place to feedback also, i starting feel frustrated with the upgrade pace)....

a framework have only 1 year lifespan time?? (most of my works still in version 6 because of the LTS...) release date - September 8th, 2020 bug fixes until - March 8th, 2021 security fixes until - September 8th, 2021

by the time we master it and build few projects and deploy... new version may already release and the version you just using already not supported.... i think that's why not seeing and "Learn laravel from scratch" series for 7, as by the time the series complete the new version may already half way release.... i guess...

can someone slow down the version upgrade???

Activity icon

Awarded Best Reply on Implementing Some Simple Roles For Users

This brings me to a side question: should I have an "Unapproved" or "Unassigned" role as a default role?

It depend, you can do so, or consider make a role as default, in your case, perhaps Parent is the default role and parent can create user with child role only...

should I just hardcode my list of roles somewhere within my models (or somewhere else) instead of storing this information in the database?

if you are pretty sure your application will NEVER change then you can hardcode it for simplicity, but if you want to manage it, store it in database is better choice so you can rename it, add new role...

just to clear up a few things with my User model, it sounds like I'd have a nullable parent_id field on all of my User models, is that correct?

I think it's nothing wrong to have a nullable or 0 parent_id to determine the user as parent, to database, it's just a value, but you are the brain on the system to decide how to do with this value...

the policy is usually functions as declaration of the rules/policies to determine what condition to allow on that MODEL, so that you can call the policy checking on your controller or blade file...

Activity icon

Replied to API Resources & Best Practices

I had requested few times since years ago and still patiently waiting for the day come... Hahaha...

Activity icon

Replied to Get Json Data In Blade

use ``` before and after the code it will ease other to view

call $ParamData directly

'{{ $ParamData }}';
Sep
09
1 week ago
Activity icon

Replied to Laravel 7 Pagination Display Blank Next Pages After Filter

the code above did not seem so....

show your code with appends()...

Activity icon

Replied to Implementing Some Simple Roles For Users

This brings me to a side question: should I have an "Unapproved" or "Unassigned" role as a default role?

It depend, you can do so, or consider make a role as default, in your case, perhaps Parent is the default role and parent can create user with child role only...

should I just hardcode my list of roles somewhere within my models (or somewhere else) instead of storing this information in the database?

if you are pretty sure your application will NEVER change then you can hardcode it for simplicity, but if you want to manage it, store it in database is better choice so you can rename it, add new role...

just to clear up a few things with my User model, it sounds like I'd have a nullable parent_id field on all of my User models, is that correct?

I think it's nothing wrong to have a nullable or 0 parent_id to determine the user as parent, to database, it's just a value, but you are the brain on the system to decide how to do with this value...

the policy is usually functions as declaration of the rules/policies to determine what condition to allow on that MODEL, so that you can call the policy checking on your controller or blade file...

Activity icon

Replied to Long Live Tokens

in .env file, declare the value

TOKEN_KEY=YOURKEYVALUE

in your config/services.php (or create your own file), append it before the last ];

	'yourservice' => [
		'key' => env('TOKEN_KEY'),
	],

in your application

$token = config('services.yourservice');

https://laravel.com/docs/7.x/configuration

Activity icon

Replied to Long Live Tokens

most people store it in database, some store in .env file and configure and call from config file... in your case, i think database is better option.

Sep
08
1 week ago
Activity icon

Replied to Weird Error After Fresh Install Of Tall Stack With Auth

check the error(s) on the console...

Activity icon

Replied to What Is The Good Practice Of Using Route?

in version 7 and earlier, the documentation use PhotoController but in version 8, 'PhotoController::class' is in used. I think both are identical... you can print out the route list (php artisan route:list) to double check and compare... I guess the 404 may due to the "plural"

Activity icon

Replied to Storing Google Analytics & Facebook Pixel Code In DB (JS CODE)

perhaps, put the script as partial file (since it's unlikely to change often) and store only the "id" or "key" in database, call the script when the "key" exist ....

Activity icon

Replied to What Is The Good Practice Of Using Route?

https://laravel.com/docs/7.x/controllers#resource-controllers

Laravel resource routing assigns the typical "CRUD" routes to a controller with a single line of code.

it's just to simplify your works from repeating creating the same standard route list if your controller use all these method

Sep
07
2 weeks ago
Activity icon

Replied to Weird Error After Fresh Install Of Tall Stack With Auth

perhaps double check the route name first

Activity icon

Replied to Help With A Filter In One-to-many Relationship

I tested your code, copy both model and blade that you shared and it's working as expected and even with the search filter as well. You may double check whether you key in the book and subject accordingly... by the way, putting the request() as the parameter in the query which by pass validation does not seem as an good idea in term of security and also calling the search filter for each book record at the blade will causing heavy performance issue if there are huge books records....

Out of the topic, from my understanding, usually there is a subject which may has many books instead of one book has many subjects, for example, Mathematics subject will have many books

subjects

	Schema::create('subjects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->bigInteger('book_id');
            $table->timestamps();
        });
id|name	|	book_id
'1', 'Subject 1', '1', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'2', 'Subject 2', '1', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'3', 'Subject 3', '2', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'4', 'Subject 4', '3', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'5', 'Subject 5', '4', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'6', 'Subject 6', '5', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'7', 'Subject 7', '2', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'8', 'Subject 8', '4', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'9', 'Subject 9', '5', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'10', 'Subject 10', '5', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'11', 'Subject 11', '4', '2020-09-08 04:37:05', '2020-09-08 04:37:05'
'12', 'Subject 12', '3', '2020-09-08 04:37:05', '2020-09-08 04:37:05'

books

	Schema::create('books', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->timestamps();
        });

book model

    protected $fillable = [ 'name', 'subject_id'];

    public function subjects()
    {
        return $this->hasMany(Subject::class);
    }


    public function subjectsWithSearch()
    {
        // I need to filter this relationship , something like 
        return $this->hasMany(Subject::class)->where('name', 'like', '%' . request('keyword') . '%');
    }

blade

			<div class="row">
				@foreach ($books as $book)
					{{ $book->name }}
					<ul>
					@foreach ($book->subjectsWithSearch as $subject)
						<li> 
							{{ $subject->name }}
						</li>
					@endforeach
					</ul>
				@endforeach
			</div>

result for all

Book Title 1
Subject 1
Subject 2
Book Title 2
Subject 3
Subject 7
Book Title 3
Subject 4
Subject 12
Book Title 4
Subject 5
Subject 8
Subject 11
Book Title 5
Subject 6
Subject 9
Subject 10

result with keyword=1

Book Title 1
Subject 1
Book Title 2
Book Title 3
Subject 12
Book Title 4
Subject 11
Book Title 5
Subject 10

Sep
02
2 weeks ago
Activity icon

Replied to Help With A Filter In One-to-many Relationship

try coding first and paste the code (including the model, relationship, controller and blade) and result....

you can try with('subjects) when query the Book model if you have the relationship setup, return the $books results before pass it to blade...

Activity icon

Replied to I Am Trying To Get Total Amount Conditional And Per Month

try

->groupByRaw('MONTH(created_at)', 'YEAR(created_at)')

or simply use selectRaw with your SQL query statement