tisuchi

Software Developer at GLEIF

Member Since 6 Years Ago

Frankfurt, Germany

Experience Points
783,775
Total
Experience

0 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
1880
Lessons
Completed
Best Reply Awards
718
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 50
783,775 XP
Apr
10
3 days ago
Activity icon

Awarded Best Reply on How To Use Helper Function Directly In Blade In Laravel 6

@nafeeur10 I don't know exactly how did you register your helper.

Follow this document. It may help you.

https://medium.com/@razamoh/create-own-custom-helper-functions-classes-in-laravel-e8d2f50ff38

Apr
09
4 days ago
Activity icon

Replied to What Technology To Use For A New Project?

@new-2-lara It always depends on your preferences. As of my understanding from your points, you can either choose wordpress (where you don't have to write code literally) OR use laravel where you could have a lot of flexibility for implementation.

Side Note: For using laravel you may need good knowledge of PHP (OOP).

Activity icon

Replied to Collection Replace ?

@ajvanho I guess you don't need to use collection here if it is an array. You can try this-

    $lists = [
        "key" => "7beqbabdHqdd3NMZ",
        "attributes" => [
            "url" => "GitHub",
            "name" => "https://github.com/foo"
        ]
    ];

    $replacedValues = [
        "name" => "GitHub",
        "url" => "https://github.com/foo",
    ];

    $finalOutput = array_replace($lists, $replacedValues);

Apr
04
1 week ago
Activity icon

Replied to Get User Phone Number Using Wechat API

@jkrantz It seems it's possible. Have you checked this post? https://programmersought.com/article/66685893412/

Mar
28
2 weeks ago
Activity icon

Replied to How I Reflector My Code

@austinbryan Welcome to the Laravel World.

Honestly, as long as your code works, there is nothing wrong with that. But there are a lot of ways to improve your code. I believe it's all about fundamental parts.

I would recommend you to watch this series.

https://laracasts.com/series/code-reflections

Mar
23
3 weeks ago
Activity icon

Awarded Best Reply on Create Internal Links On Website

@mbo You may not get the exact plugin on Laravel.

But what I suggest you that, since you know already what to build is just build from the sketch. That will help you to improve the knowledge!

Mar
14
4 weeks ago
Activity icon

Replied to Can I Do A Preg_match_all With Collection ?

@untymage If it is the collection, what if you use get()->each(), then pass the regular expression inside the closure in each() method?

Mar
11
1 month ago
Activity icon

Awarded Best Reply on Get Attributes From Image File

@david19 If you want to get the size of the file after uploading, I guess the easiest way to do that is-


$request->file('file')->getSize();
Activity icon

Replied to Get Attributes From Image File

@david19 If you want to get the size of the file after uploading, I guess the easiest way to do that is-


$request->file('file')->getSize();
Activity icon

Replied to Create Internal Links On Website

@mbo You may not get the exact plugin on Laravel.

But what I suggest you that, since you know already what to build is just build from the sketch. That will help you to improve the knowledge!

Mar
04
1 month ago
Activity icon

Awarded Best Reply on How Do You Test A Function That Returns A Generator?

@kevdev Yes, that's what I mean.

However, if you need to test implicitly, then you can follow this discussion: https://stackoverflow.com/questions/41343279/mocking-a-function-that-returns-a-generator-in-php-with-phpunit-phake

Feb
25
1 month ago
Activity icon

Replied to Calculating Subtotal

@glitter grace What if you add an another variable called sub_total and then return this?

<script>
	export default{
	    props: [],
	    data(){
	        return {
	            products: [],
	            product_unit: null,
	            product_price: null,
	            sub_total: null,
	        }
	    },
	    computed:{
	        calculateAmount(){
	            this.sub_total = this.product_unit * this.product_price;
	        },
	        subTotal(){
	            return this.sub_total;
	        }
	    },
	    methods: {
	        getProducts(){
	            axios.get(`/api/product/all`).then(response => {
	               this.products = response.data.products;
	            });
	        }
	    },
	    mounted() {
	        this. getProducts();
	    }
	}
</script>

Activity icon

Replied to Can Anyone Explain Me Why It Returns This Output?

@prince69 Probably you can use lazyload.

$user_order = auth()->user()->load('orders.orderFoodItems.price');

if ($user_order->count()) {
    return response()->json($user_order, 200);
}
Activity icon

Replied to Nested Relationship To Match Column Of Base Modal

@deekshith Have you just used get() instead of using first()?

$registeredCourse = UserRegisteredCourse::where('course_id',$test->course_id)->where('user_id',$test->user_id)->get();
Activity icon

Replied to Nested Relationship To Match Column Of Base Modal

@deekshith I am not so sure what exactly you want to achieve, but for nesting relationship, you need to use . notation.

For example-

->with('relationship.nestedRelationship')

Ref: https://laravel.com/docs/8.x/eloquent-relationships#nested-eager-loading

To optimize uses of with(), you can use like that-

OfflineConvertedTest::with([
		'userdet',
		'slotdet',
		'coursedet',
		'centerdet',
	])->whereIn('test_id',$getTestids)
	->get();

Sidenote: It's not related to solving your issue.

Feb
24
1 month ago
Activity icon

Replied to How To Store Rate Field In Pivot Table In Laravel

@coder72 Make sure that the rate column is fillable in the model.

Besides, I notice that, you have a type. Probably its array('rate' => $ite) insead of array('rate' => $item).

  $user->items()->sync($request->item, array('rate' => $ite));
Feb
15
1 month ago
Activity icon

Awarded Best Reply on How To Make Custom Login Only For Admin In Laravel?

@ihprince Just apply a condition insider if.

if (Auth::attempt($credentials)) {
       	if(Auth::user()->is_admin !== 1){
       		// Now redirect to the user's login page
       	}

       	// Now redirect to the admin panel
    }
Activity icon

Replied to How To Make Custom Login Only For Admin In Laravel?

@ihprince Just apply a condition insider if.

if (Auth::attempt($credentials)) {
       	if(Auth::user()->is_admin !== 1){
       		// Now redirect to the user's login page
       	}

       	// Now redirect to the admin panel
    }
Feb
11
2 months ago
Activity icon

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

@kevdev If you don't need to cross-check with the exact data return type, then you may check the instanceOf. Check whether it returns the right instance or not.

Feb
06
2 months ago
Activity icon

Replied to Converting From CST To UTC

@jmurphy1267 Since you have mentioned using it on the frontend side, why you do not use Moment JS?

Just get some idea from this discussion and apply it in a reverse way. https://stackoverflow.com/questions/34361866/how-do-i-convert-utc-gmt-datetime-to-cst-in-javascript-not-local-cst-always

Feb
04
2 months ago
Activity icon

Replied to Site 500 Error, Newbie Needs Help

@justaskkath Just in real quick you can enable APP_DEBUG=true in .env file to check what error you get. Note It's not the right solution if you have so many visitors.

Alternatively, you may use services like Bugsnag to get what's going on in your app.

Activity icon

Replied to Passing Multiple Parameters In Route To Controller

@shamsul_huda Not sure why it doesn't work but you can try this one as well instead of using name routing.

<a href="'/book/category/' . {{ $category->id }} . '/' . {{ $category->slug }}" class="row author-content px-0">View</a>
Feb
02
2 months ago
Activity icon

Replied to CORS

@fadiabadir Have you tried this package?

Activity icon

Replied to Defining Relationships Within Factories

@newbie360 Actually,

This is the definition where you define from where you get video_id by default.

public function definition()
{
    return [
        'video_id' => Video::factory(), // why we need this line ?


    ];
}

You mentioned that, if this class will be called, then

  • Create a video factory and then
  • Assign video_id by newly created video factory id.

The following is doing the same thing, but multiple times with some extra facilities.

public function run()
{
    Video::factory()->count(10) // create 10 videos
        ->hasVideoKeywords(2)   // each video add 2 keywords
        ->create();
}
Activity icon

Replied to Multiple Approval Process In Laravel

@prasadchinwal5 A general rule of thumb:

If you CC / mention someone in your thread, other contributors may ignore your question. :)

Jan
16
2 months ago
Activity icon

Awarded Best Reply on Search In Table Related To Eloquent

@datanorte You can use whereHas() in that case. I assume that brand table has name field and category has title filed those you want to search.

public function render()
{
    $data_products = Product::with('brand', 'category')->orderBy('id', 'desc')
        ->where('name', 'like', '%' . $this->search . '%')
        ->orWhereHas('brand', function($query) use($search = $this->search){
        	$query->where('name', '%' . $search . '%')
        })->orWhereHas('category', function($query) use($search = $this->search){
        	$query->where('title', '%' . $search . '%')
        })->paginate($this->perPage);

    return view('livewire.products', compact('data_products'));
}

Note: You need to adjust the query based on your requirements.

Ref: https://laravel.com/docs/8.x/eloquent-relationships#querying-relationship-existence

Activity icon

Awarded Best Reply on IsoFormat Error In Laravel

@amit028 Is that somehow a composer installation issue?

Can you try this?

composer clearcache
composer install
Jan
12
3 months ago
Activity icon

Replied to Composer Error When I Try To Use Composer Commands

@deekshith It's a php / laravel package.

Allow you to display update/upgrade instructions to your library users.

Ref: https://github.com/kylekatarnls/update-helper

Activity icon

Replied to Composer Error When I Try To Use Composer Commands

@deekshith This means, your php version is 7.1.33 but for some reasons (probably some of the packages need a higher version of php) composer required 7.2.5 version or above.

So, if possible, I strongly suggest you to upgrade php version at least. It's recommeneded also to upgradate Laravel version (The current version is 8 and you are using 5.5)

Activity icon

Replied to Composer Error When I Try To Use Composer Commands

@deekshith Try-

I have had to delete the directory kylekatarnls located inside my vendor directory then run composer update --prefer-source and after that composer dump-autoload.

Ref: https://stackoverflow.com/questions/61236961/composer-dump-autoload-or-update-results-in-fatal-error-on-laravel-5-5

Activity icon

Replied to Take Specific Column From Multi-dimensional Arra

@tapas Doesn't it simpler approach?

Model::get('company_name', 'position');
Jan
09
3 months ago
Activity icon

Replied to Display Products Of Each Category In Laravel

@mehrdad70 Try this-

public function showCourses()
{
    $courses = Course::with('categories')->get()

	retuern view('front.courses.all-courses', compact('courses'));
}

all-courses.blade.php

@foreach($courses as $course)
	// To print anything from category table
	{{ $course->categories->fieldName }}
@endforeeach

Here you need to adjust the fieldName based on your table column.

SideNote: I highly recommend you to check this doc and watch some basic laravel series that will boost up your skills.

Jan
08
3 months ago
Activity icon

Replied to How To Save Two Different Data In One Column.

@emfinanga It's because of you are assigning slave_id into unit_id. Look at your following code that is wrong-

$data = New Mystock;
$data->unit_id = $value->unit_issue_id;
$data->unit_id = $value->slave_id;

It should be like this-

$data = New Mystock;
$data->unit_id = $value->unit_issue_id;
$data->slave_id = $value->slave_id;
...

You just adjust your $data->slave_id if the table column is wrong.

Jan
07
3 months ago
Activity icon

Replied to BestšŸŖ”Way

@konstruktionsplan First of all, your query has an issue mentioned by @prasadchinwal5 . Check it out.

Secondly, if you are looking for the best way, then I would recommend you to use eloquent for that. Since you are able to join tables via the foreign key, you can easily build a relationship between them. Then you can create a dedicated method to grab the point.

Activity icon

Replied to File Upload Refactoring

@uniqueginun The approach suggested by @tray2 looks clean enough already.

Why not you just create separate methods and handle all the logic insider them.

BTW, you can use a loop if you want, but since you can solve any issue without the loop, then what is the purpose of using it? Looping will make iteration, which may affect your performance (depends on how many times it iterate). Therefore I believe looping is unnecessary use here.

Activity icon

Replied to Develop RSS News Feed With Laravel And RSS Tracker In Localhost?.

@munazzil If I understand you correctly, you want to fetch real-time.

In that situation, you need to use any JS library / Cron Job for pulling data at certain intervals. Or you need to use any third-party library to solve the issue.

Activity icon

Replied to File Upload Refactoring

@uniqueginun First of all, if your current code works fine, I would say just follow the simple step, that currently has.

Secondly, if you submit multiple form on same action and not sure whether in future it will submit more form or not, on that situation, you can follow a separate class for each form submittion based on a contract (Interface), that will be following Open Closed Principle (Some may be refer it over engineering of it here).

That's what I can think of now.

Jan
06
3 months ago
Activity icon

Awarded Best Reply on Accessing Parent Method From Subclass Instantiation

@zaimazhar You just add return $this; in your awarded() method. That should work.

public function awarded($user) {
        $this->user = $user;

        return $this;
    }
Activity icon

Replied to Accessing Parent Method From Subclass Instantiation

@zaimazhar You just add return $this; in your awarded() method. That should work.

public function awarded($user) {
        $this->user = $user;

        return $this;
    }
Activity icon

Replied to File Upload Refactoring

@uniqueginun Why do you need refactoring here? I cannot see any complexity here.

Community Pillar

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