KDev

PHP Developer at Homebase

Member Since 5 Years Ago

Taytay Rizal

Experience Points
31,890
Total
Experience

3,110 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
257
Lessons
Completed
Best Reply Awards
4
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.

  • Community Pillar

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

Level 7
31,890 XP
Apr
19
3 weeks ago
Activity icon

Replied to Laravel 8, Moving User Model Will Destroy UserFactory And Tests

will try it. i hope it works. thanks

Activity icon

Started a new Conversation Laravel 8, Moving User Model Will Destroy UserFactory And Tests

I have a fresh installed Laravel 8 (using php 8) and I moved the User model from App\Models\User to App\Domains\User\Models\User using phpstorm.

But after I move it out. I test it manually and it works with some changes on the route files.

But the feature testing using phpunit that comes with laravel breeze is not working anymore. The issue is that the UserFactory is not found.

This is the error that I got.

Class "Database\Factories\Domains\User\Models\UserFactory" not found

I already tried composer dump or composer dump-autoload but still not working.

I already check the composer.json autoload and it seems to be normal since this is a fresh installed laravel 8.

https://stackoverflow.com/questions/67162934/laravel-8-moving-user-model-will-destroy-userfactory-and-tests

Apr
10
1 month ago
Activity icon

Awarded Best Reply on Livewire Click Event Not Working

thanks for the responses. i just figured out the issue. some of my team added a stylesheets inside the livewire.,

what I did is to put the stylesheet on the parent div. and also to make sure that the livewire blade file only has 1 parent div.

Activity icon

Replied to Livewire Click Event Not Working

thanks for the responses. i just figured out the issue. some of my team added a stylesheets inside the livewire.,

what I did is to put the stylesheet on the parent div. and also to make sure that the livewire blade file only has 1 parent div.

Activity icon

Started a new Conversation Livewire Click Event Not Working

Hi,

I have a dropdown with an click event using livewire. it was working few days/weeks ago but suddenly it stop working. And I cant figure out why it that.

here some code on my blade file.

<ul>
    <li><a wire:click.prevent="selectCategory('all')">Categories<span class="value">1</span></a></li>
    @forelse ($categoryListOptions as $category)
        <li>
            <a wire:click.prevent="selectCategory('{{ $category['name'] }}')">
                {{ $category['name'] }}
                <span class="value">{{ $category['id'] }}</span>
            </a>
        </li>
    @empty
    @endforelse
</ul>

and here is the function its calling

public function selectCategory(string $category)
{
    Log::info($category);
    $this->selectedCategory = $category;
}

Thanks in advance for those who try to help.

Mar
16
2 months ago
Activity icon

Replied to Unable To Cache Routes

ohh I see. thanks for the insight.. maybe thats why

Activity icon

Replied to Unable To Cache Routes

thanks. are you talking about this? "Since this feature uses PHP serialization, you may only cache the routes for applications that exclusively use controller based routes. PHP is not able to serialize Closures."

this is so weird. I have a diffirent project that I use a lot of clousure but route caching still works

Activity icon

Started a new Conversation Unable To Cache Routes

Hi, I am working on a existing laravel 7 project and I cant cache the routes.. anyone have encounter this issue? can you give me some hint where to check ??

here some error i got

 Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Clo
  sure.
Mar
15
2 months ago
Activity icon

Replied to How To Composer Install On Other Directory Not Vendor?

well the main requirement is to push the vendor directory into the git repo. and at first I dont really like that. i think it is required by the deployment tool and it is not allowed to run composer command on the server.

so i think what if i push a new ("dist") directory containing the composer packages ("without the dev deps") instead of the vendor directory so that I still have my vendor on my local machine being ignore with dev deps.

Activity icon

Replied to Can I Install NOVA On A Different Sub Domain?

thank you for confirming.

Activity icon

Replied to Laravel 8: QueueManager.php:156 Array Offset Of Type Null / Configure Redis

maybe try clearing cache after you put it on your .env try running

php artisan cache:clear
Activity icon

Replied to Laravel 8: QueueManager.php:156 Array Offset Of Type Null / Configure Redis

add this REDIS_CLIENT on your .env and see if the error changes

REDIS_CLIENT=phpredis 
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Activity icon

Replied to Mixing Php With Nodejs

if I were you I'll just put it on root directory and isolate it from other laravel files. some thins like this.

/app
/bootstrap
/config
/database
/nodeServer
/resources
...
...
Activity icon

Replied to Controller Edit Action - Model Casting Fails

normally what I do to bind models from route is just follow whats on the documentation.. for example this codes is working from one of my projects. see below..

# routes
Route::post('/post/{post}/comment', [PostController::class, 'comment'])->name('user.forum.comment');


# comment action on post controller
    public function comment(Post $post, CommentRequest $request)
    {
        $this->postService->comment($post, $request->validated());
        return redirect('post/'. $post->slug);
    }

Activity icon

Replied to Controller Edit Action - Model Casting Fails

can you show us your route for this action?

Activity icon

Replied to How To Composer Install On Other Directory Not Vendor?

ohhhh thats why it didnt install because the dist directory is fresh and empty. I got the error now. but i wonder if theres a way to put all your files into different path..

Activity icon

Replied to Query Builder Multiple Sub Queries

spend 27 minutes here and Im sure you'll get your answer plus some tips on how to improve your eloquent performance

heres the video: https://www.youtube.com/watch?v=IBUXXErAtuk

Activity icon

Replied to How To Composer Install On Other Directory Not Vendor?

yes.. most like that will gonna happen. i hope it works

Activity icon

Replied to How To Composer Install On Other Directory Not Vendor?

I also got confuse on this requirements. I never experience this before to change the vendor path :)

Activity icon

Started a new Conversation Can I Install NOVA On A Different Sub Domain?

I am thinking of using laravel nova on my upcoming project but I am wondering on the SOLO package if I am allowed to deploy my laravel nova on a dev server or other server instance.. before I go to production.

Activity icon

Replied to How To Composer Install On Other Directory Not Vendor?

yes but that is the requirement. i think its about the deployment tool they are using..

Activity icon

Started a new Conversation How To Composer Install On Other Directory Not Vendor?

Hi,

How can I install composer packages but not on vendor directory? i have a project that requires me to chagne the vendor folder into something else.

is there a command in which I can install it on vendor and also on ther other directory like prod_vendor or something else?

Edit: Im using composer version 1.10.13

I have tried this one.

php /usr/local/bin/composer install -d /var/www/html/prod_vendor/

but right after running the command I got this error.

Composer could not find a composer.json file in /home/www/project/dist
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Mar
13
2 months ago
Activity icon

Replied to Socialite Facebook Data Deletion Callback

yes i mean what would that confirmation_code and for the url is will you put on that url/page..

Mar
12
2 months ago
Activity icon

Started a new Conversation Socialite Facebook Data Deletion Callback

Hi, Anyone here experience implementing facebook data deletion callback? I got stuck now on this part. I already create a callback but it is not deleting. here is how I delete the user but i dont have idea what to put on url and confirmation_code

public function dataDeletionCallback(Request $request)
{
    $signed_request = $request->get('signed_request');
    $data = $this->parse_signed_request($signed_request);
    $user_id = $data['user_id'];

    // here will delete the user base on the user_id from facebook
    User::where([
        ['provider' => 'facebook'],
        ['provider_id' => $user_id]
    ])->forceDelete();

    // here will check if the user is deleted
    $isDeleted = User::withTrashed()->where([
        ['provider' => 'facebook'],
        ['provider_id' => $user_id]
    ])->find();

    if ($isDeleted ===null) {
        return response()->json([
            'url' => '<url>', // <------ i dont know what to put on this or what should it do
            'confirmation_code' => '<code>', // <------ i dont know what is the logic of this code
        ]);
    }

    return response()->json([
        'message' => 'operation not successful'
    ], 500);
}

Thanks in advance for those who will share thier experience

Activity icon

Replied to Laravel Dusk Full Page Screenshot

thanks gonna try this. i'll accept this if it works

Mar
10
2 months ago
Activity icon

Replied to Use Relation From Pivot Table

oh yes sorry i miss that product_store_price table.. but may I ask why you need product_store_price table? you can put the price column on your pivot table.

Activity icon

Replied to Run Laravel Project Without Source Code

Here is my idea. maybe you make your app a multitenancy app or a SaaS your code is on your own server and the client will not get it but still they can use your app.

or before around 2012 i have experience working on a website that the code is being encrypted with ioncube. i dont know how it really works but the code is encrypted and I cant edit or see it.

Activity icon

Replied to Use Relation From Pivot Table

yeah that will work. i tried it on my end but ofcourse on different model/column but same syntax

App\Models\Film::withTrashed()->find(1000)->genres[0]->pivot->genre_id

and its working

Activity icon

Replied to JsonResponse GetData - Only Specific Data

i would not suggest this approach. why you are calling store function into update function?? you can just simple do this.

public function update(Request $request, $id) {
    $successValue = false;

    // change the model with the correct model you are using
    if (Model::find($id)->update($request->validated())) {
        $successValue = true;
    }
}
Activity icon

Started a new Conversation Laravel Dusk Full Page Screenshot

How can I take fullpage screenshot on laravel dusk headless testing? I do something but I only get the visible part.

    /**
     * A Dusk test example.
     *
     * @return void
     */
    public function testAuthenticated()
    {
        $this->browse(function (Browser $browser) {
            $browser->loginAs(1)->visit('/browse')
                ->assertSee('CATEGORIES')
                ->screenshot('authenticated_test_screenshot');
        });
    }

Activity icon

Replied to Use Relation From Pivot Table

yes.. you can do that but i dont see prices column on your code ..

Mar
07
2 months ago
Activity icon

Commented on Change Detection

finally its here

Activity icon

Replied to Limit Nova Dashboard To Admin User Only

thanks for the link

Activity icon

Started a new Conversation Limit Nova Dashboard To Admin User Only

Hi,

I am planning to use nova in my upcoming project that will start in few days or week. I want to use nova only on the specfic users that has a is_admin set to true. is this possible?

can you show me some code on how to do it because I still dont have nova right now at the moment.

Thank you so much

Activity icon

Commented on Custom Themes

i can't believe this whole power features is only 99 dollars. going to use this on my upcoming projects.

Mar
05
2 months ago
Activity icon

Replied to Validation Rule Changes The Data

can you show your codes. I guess you have assign the $value into a string or something like this (int) $value and it removes the +

Activity icon

Replied to Using Queue:work With Systemd - Service Restarted Each ~10mn

Hi, I use the same (systemd) on my production server using ubuntu. Maybe the issue is with the user or group. maybe try adding a group on your worker config. I also notice the --daemon option. I am not familiar with it so I check it. and base on the php artisan queue:work --help it says deprecated. maybe thats the cause of the issue. since this is a process already i think you dont need to include --daemon option

Activity icon

Replied to How Do You UNIT Test Your Controller?

exactly!! thank you

Mar
04
2 months ago
Activity icon

Replied to How Do You UNIT Test Your Controller?

yes. actually i got confuse also. the tasks is UNIT testing controller and what I have in mind is testing it using HTTP test

Activity icon

Awarded Best Reply on Can I Put The Jobs On Different Server? Is This A Bad Approach?

to answer my own question.

I did it and it works. I have separate servers for my app and for workers only.

Activity icon

Replied to Can I Put The Jobs On Different Server? Is This A Bad Approach?

to answer my own question.

I did it and it works. I have separate servers for my app and for workers only.

Activity icon

Replied to Unknown Html Tag In Phpstorm

i guess this is the best we can do. i'll accept this as an answer thanks

Activity icon

Started a new Conversation How Do You UNIT Test Your Controller?

Hi. I really dont do unit testing on my controllers classes. And I just got a tasks that requires me to do it. can you guys give me some idea on how to UNIT test a controller class ?

Feb
28
2 months ago
Activity icon

Replied to Where To Learn? ... Tried Laracasts!

laravel 6 is pretty much the same. i suggest you to try some long series while waiting for another series in the latest laravel version. getting familiar with old laravel version is still worth it and thers not much of differences. its has the same logic and flow on how to do things on laravel. except on laravel 4 and below. laracasts is really worth it and will help you improve furthere if you really know php/laravel..

Activity icon

Started a new Conversation Looking For Laravel CI/CD Premium Tutorials On Aws K8s Or Ecs

Hi Everyone,

I have a running project with laravel8 and the projects traffic is not really stable (sometimes its peak and alot of times its idle). so I want to make it a auto scalling on ECS or k8s. but i dont know how to do it. I also like to make it CI/CD so the deployment is not that hassle.

The current setup on the ec2 is the traditional way (LEMP stack, with git and the deployment is pulling some tags and running some commands like composer install, php artisan commands etc.) and i want it to be automated using CI/CD.

Can you suggest a premium laravel CI/CD tutorial on where can I learn that? i preffer with aws ecs and github actions. but i am open to switch if theres a better option.

My project is always up to date to the latest laravel version and upgrading to php8 is not a problem to me if its tested and proven working.

Btw i am knowleagable on docker since our local setup is using docker except on production because as I said i dont know k8s and ecs yet.

thanks

Feb
11
3 months ago
Activity icon

Replied to How Do You Test A Function That Returns A Generator?

yes i think i dont need to check exact data. so i'll just assert the instanceof if it is a generator?

Activity icon

Started a new Conversation How Do You Test A Function That Returns A Generator?

Hi I have a simple service that will fetch a data api and then loop it with generator. and i dont have any idea how will i do it. please see below some example of what class that i want to test.

class Service
{
	public function fetchData()
	{
		$response = Http::get('https://external.api/data');

		if ($response->status() === 200) {
			foreach ($response->json()['data'] as $data) {
				yield $data;
			}
		}
	}

	public function setup()
	{
		foreach ($this->fetchData as $value) {
			(new ProcessData)->process($value);
		}
	}
}
Feb
10
3 months ago
Activity icon

Started a new Conversation Laravel 8 Jetstream Not Redirecting After Login

Hi, I wonder how to change redirect url after successful login. I have tried changing the RouteServiceProvider::HOME class const to from '/' to '/browse' but i still redirected to '/' after login

Feb
03
3 months ago
Activity icon

Started a new Conversation Unit Testing A Model Class

Hi, do you guys do a unit test on your model class? like if you have a unit test on your service and repository class and you also have a feature test on your controller. do you still need test on your models?

Jan
10
4 months ago
Activity icon

Replied to Is There A Way To Stop IDM From Download My Videos

are you using HLS or DASH?? i havent tried using idm but other video downloader will not work using HLS or DASH protocols.