tisuchi

Software Developer at GLEIF

Member Since 6 Years Ago

Frankfurt, Germany

Experience Points
803,995
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
2005
Lessons
Completed
Best Reply Awards
728
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
803,995 XP
Jun
11
1 day ago
Activity icon

Awarded Best Reply on Auto Play Turn Off At Laracasts Lessons.

@hellomohsinhello It's one of the demandable topics in the discussion group. So far I know, it's not implemented yet. Probably @JeffreyWay will take care of it in the future.

https://laracasts.com/discuss/channels/site-improvements/disable-autoplay-feature

Activity icon

Replied to Auto Play Turn Off At Laracasts Lessons.

@hellomohsinhello It's one of the demandable topics in the discussion group. So far I know, it's not implemented yet. Probably @JeffreyWay will take care of it in the future.

https://laracasts.com/discuss/channels/site-improvements/disable-autoplay-feature

Activity icon

Replied to Get A Relationship With Count When Using SetRelations Helpers

@wakanda Which version of Laravel you are using?

How about trying ->withCount() before the -setRelations()?

Jun
10
2 days ago
Activity icon

Commented on Optimizing Window Splits

@ikiwi I left this course somewhere in 2016. I believe that one was the biggest mistake in my life!!!

Just let you know that I started this again! So, it's never late actually.

Jun
08
4 days ago
Activity icon

Awarded Best Reply on Send Mail On Exception

@marlonv Isn't that you have to loop the list of the admin user?

For example-

\Mail::send('emails.exception', compact('css','content'), function ($message) {
	foreach($reciepments as $recipient){
		$message->to($recipient)->subject('Exception: ' . \Request::fullUrl());
	}
});
Activity icon

Replied to Multiple Authentication From Different Tables In Laravel 8

@msaad If I understand you correctly, you can use Spatie Permission .

Jun
04
1 week ago
Jun
02
1 week ago
Activity icon

Commented on Stubs Versus Mocks

It's a Mind-blowing comparison!!!

May
30
1 week ago
Activity icon

Replied to Vimeo Access Token Errors

@successdav I don't know how did you implement your code, but have you checked this?

https://github.com/vimeo/laravel/issues/53

Activity icon

Replied to Accessing Parent Value Inside Eloquent Relation

@saluei I believe the easiest way you can do it just to define another relationship method.

For example-

public function someMatchedFiled()
	{
	    return $this->belongsTo('App\matches', 'some_field_in_matches', 'some_id');
	}

The whole code will be-

calss parent_model{

	private  $some_id;

	public function __construct()
	{
		$this->$some_id=100;
	}


	public function matches()
	{
	    return $this->belongsTo('App\matches', 'parent_model_id', 'matches_id');
	}

	public function someMatchedFiled()
	{
	    return $this->belongsTo('App\matches', 'some_field_in_matches', 'some_id');
	}
}
Activity icon

Replied to SAAS Project With Web & Mobile Apps

@cmiddlebrook If I understand you correctly, you can design your application like that way:

  • API: Build API via Laravel.
  • Web Application Interface: You can use any reactive JS framework i.g. VueJs / ReactJS. Now you call API for data manipulation and interaction.
  • Build Mobile Apps: Since you have API, you can use that for building a mobile app in any suitable language.

Architecture

Activity icon

Replied to Laravel Passport With Redis

@svardiashvili If you are able to use redis everywhere, then I believe it's some compiled issue. Have you tried with the following commands?

php artisan clear-compiled
composer dump-autoload
Activity icon

Replied to Send Mail On Exception

@marlonv Isn't that you have to loop the list of the admin user?

For example-

\Mail::send('emails.exception', compact('css','content'), function ($message) {
	foreach($reciepments as $recipient){
		$message->to($recipient)->subject('Exception: ' . \Request::fullUrl());
	}
});
May
29
2 weeks ago
Activity icon

Replied to Cannot Add Or Update A Child Row A Foreign Key Constraint Fails Laravel Factory

@mehr What are the foreign keys here?

Can you show your migration file?

Activity icon

Replied to Permission Denied For Daily Logs In Laravel

@amirkamizi You can pass permission also in mlog.

For Example-

'mlog' => [
    'driver' => 'daily',
    'path' => storage_path('logs/mlog.log'),
    'level' => 'debug',
    'permission' => 0777,
],
Activity icon

Replied to Relational OneToMany Error

@amaxx You simply pass the foreign key.

public function resident() {
    return $this->belongsTo(Resident::class, 'family_card_id');
}
public function familycard() {
    return $this->hasMany(FamilyCard::class, 'family_card_id');
}

Ref: https://laravel.com/docs/8.x/eloquent-relationships#one-to-many

May
24
2 weeks ago
Activity icon

Replied to Show Results From 2 Models

@marcolino922 Have you tried leftJoin() or join()?

Example:

DB::table('users')
            ->leftJoin('posts', 'users.id', '=', 'posts.user_id')
            ->get();

Ref: https://laravel.com/docs/8.x/queries#left-join-right-join-clause

May
23
2 weeks ago
Activity icon

Awarded Best Reply on Inserting Data Into Laravel Database From Non-Laravel App

@garet

Honestly in your situation, I would love to go with API. In my understanding, API would be the best approach here. API doesn't care you access from what types of apps. As long as the requested follow the API style, that should be fine to access data.

I suggest you follow API here.

May
19
3 weeks ago
Activity icon

Replied to COUPONS, PLEASE?

@syntacticgeorge Yes, you cannot get it until Black Friday.

Activity icon

Replied to Column Not Found: 1054 Unknown Column 'ip_address'

@noblemfd Show your LogActivityModel migration file.

May
16
3 weeks ago
Activity icon

Commented on How Do I Handle Policy Authorization

Hey @reinink

Nice to see you in Laracast ;)

May
15
4 weeks ago
Activity icon

Replied to WhereIn Similar Function For Array Json Content

@aweb Have you tried this?

// Josn Data
$json = [{"level_id": "3"}, {"level_id": "5"}, {"level_id": "7"}];

->whereRaw('JSON_CONTAINS(level_id, ?)', [json_encode($json)])
May
14
4 weeks ago
Activity icon

Awarded Best Reply on Target [App\Interfaces\Auth\AuthInterface] Is Not Instantiable While Building

@noblemfd I think you understood the concept wrongly.

  1. You have to bind the interface against the repository.
  2. Then, call the repository for using / extension / whatever...

In your implementation, you implemented method (e.g. register()) in the interface, that doesn't make sense. The main purpose of the interface is to make sure that whatever class follows the interface, they have the same type of implementation.

A pseudo-code will be-

// AuthInterface.php
interface AuthInterface {
	public function register(Request $request);

    public function register(DriverRequest $request);
}


// AuthRepository.php
class AuthRepository implement AuthInterface {
	
	public function register(Request $request);

    public function register(DriverRequest $request)
    {
        // write your code
    }
}
Activity icon

Replied to Target [App\Interfaces\Auth\AuthInterface] Is Not Instantiable While Building

@noblemfd I think you understood the concept wrongly.

  1. You have to bind the interface against the repository.
  2. Then, call the repository for using / extension / whatever...

In your implementation, you implemented method (e.g. register()) in the interface, that doesn't make sense. The main purpose of the interface is to make sure that whatever class follows the interface, they have the same type of implementation.

A pseudo-code will be-

// AuthInterface.php
interface AuthInterface {
	public function register(Request $request);

    public function register(DriverRequest $request);
}


// AuthRepository.php
class AuthRepository implement AuthInterface {
	
	public function register(Request $request);

    public function register(DriverRequest $request)
    {
        // write your code
    }
}
Activity icon

Replied to Show Progress Bar In Laravel

@eludic First of all, you cannot show the progress bar via Laravel directly without getting the help of any JS framework/library.

Furthermore, is there any particular reason to sow a percentage-based progress bar during fetching instead of a general progress bar?

Activity icon

Replied to Install Bootstrap 5 Using NPM Or Composer ?

@lirone If you don't customize hugely, and just use bootstrap simply calling the classes in your div, I believe the easiest way would be to use CDN.

Now, if you compare between using composer and npm, I would recommend that, use NPM because:

  • CSS framework uses for frontend rendering. So, good practice would be to use JS dependency manager.
  • If you use NPM, it will be easy for you to customize in the future.
Activity icon

Replied to Routing In Non Laravel App

@marsuch You can find all the build-in packages that Laravel used. Use whatever you need.

https://github.com/laravel/framework

Activity icon

Replied to Socialite With Facebook Gives An Error

@ajay01 Have you tried this?

yum install ntp
systemctl start ntpd
systemctl enable ntpd
ntpdate -q 0.rhel.pool.ntp.org
systemctl restart ntpd

https://github.com/kreait/firebase-php/issues/163

Apr
28
1 month ago
Activity icon

Replied to Conditional Search Query

@wakanda Just to fix the typo on @tykus comment.

It should be -

->when($this->categoryId

instead of -

->when($this->$categoryId
Apr
24
1 month ago
Activity icon

Replied to Redirect Not Authanticated User

@mecjos You can keep the both option like that way.

    public function redirectTo($request)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], 401);
        }
    
        return route('login');
    }
Activity icon

Replied to Laravel: Order Query Using Relationship

@fcode

User.php

    public function contents()
    {
        return $this->hasMany(Content::class)->orderBy('updated_at');
    }

Content.php

    public function user()
    {
        return $this->belongsTo(User::class);
    }

Now, in the controller, you can write the query like this way-

// Getting all latest contents of user ID = 1
$contents = User::with('contents')->findOrFail(1);

// Getting all latest contents of user ID = 1
$contentsInLast24Hours = User::with('contents', function ($query) {
    $query->where('created_at', '>=', now()->subDay(1));
})->findOrFail(1);
Apr
23
1 month ago
Activity icon

Replied to Edit Section

@johny-22 Haha... No worries. That should be fine as long as the answer solves your issue. I am happy to see that. :)

Activity icon

Replied to Edit Section

@johny-22 Ideally YES. It is better to have two separate methods for two separate functionalities. It will give you better code tracking, idea approach for testing, and easy to read.

My opinion will go with separate functionalities.

Activity icon

Replied to Purpose Of HTMLPurifier In Laravel

@amit028

As I was building this new Kuztek site I wanted to build it to the same standards I would if I were building it for any client and that means protecting the site from malicious code or security threats. I may be the only one adding content to this site or modifying what is in the database, but filtering what we are outputting to the browser to make sure it doesn’t harm the site or our users just makes sense. We don’t want to leave our sites vulnerable to Cross-Sites Scripting(XSS). This tutorial covers Laravel customization and is intended to be used by developers to improve their site security.

When using Laravel Blade templates we typically would output content doing something like this:

Hello, {{ $name }}. 

The double curly brackets used in Blade indicate that the content will be escaped and any html code that would have been outputted will be removed automatically. But what if we want some html to come through from our database but not anything that would be a security risk? We searched around for some existing code to do the job because writing something from scratch could take a lot of time. Enter HTMLPurifier, a well maintained tool that cleans up code and even fixes things like missing html tags or illegal html nesting. To get HTMLPurifier into our Laravel project we used a handy package from MeWebStudio and added it to our site using composer.

Ref: https://kuztek.com/blog/use-laravel-purifier-security#:~:text=Enter%20HTMLPurifier%2C%20a%20well%20maintained,tags%20or%20illegal%20html%20nesting.

Apr
22
1 month ago
Activity icon

Awarded Best Reply on Adding A Div Row For A New Row In Laravel

@trifek The easiest way would be the make a row and then dividend into two columns inside the col-6 class. Then duplicate your code.

<div class="col-6">
  <div class="row">
    <div class="col-6">
        <div class="form-check py-2">
          <input id="productIngredientId-{{ $productIngredient->id }}"
                 class="form-check-input enableInput" style="margin-top:10px"
                 name="productIngredient[]" type="checkbox"
                 value="{{ $productIngredient->id }}"
                 @if($selectedProductIngredients->contains('ingredient_id', $productIngredient->id) === true) checked @endif>
          <label class="form-check-label" for="flexCheckChecked">
              {{ $productIngredient->name }} [{{ $productIngredient->short_name }}]
          </label>
          <input id="productIngredient-{{ $productIngredient->id }}" type="text"
                 name="productIngredient-{{ $productIngredient->id }}" maxlength="10"
                 class="form-control weight-input weightMask"
                 style="width:100px;display: inline; margin-left:20px" placeholder=""
                 value="{{ $weight }}">
      </div>
    </div>
    <div class="col-6">
        <div class="form-check py-2">
          <input id="productIngredientId-{{ $productIngredient->id }}"
                 class="form-check-input enableInput" style="margin-top:10px"
                 name="productIngredient[]" type="checkbox"
                 value="{{ $productIngredient->id }}"
                 @if($selectedProductIngredients->contains('ingredient_id', $productIngredient->id) === true) checked @endif>
          <label class="form-check-label" for="flexCheckChecked">
              {{ $productIngredient->name }} [{{ $productIngredient->short_name }}]
          </label>
          <input id="productIngredient-{{ $productIngredient->id }}" type="text"
                 name="productIngredient-{{ $productIngredient->id }}" maxlength="10"
                 class="form-control weight-input weightMask"
                 style="width:100px;display: inline; margin-left:20px" placeholder=""
                 value="{{ $weight }}">
      </div>
    </div>
  </div>
</div>
    
Activity icon

Awarded Best Reply on How To Attach Different Files Via Emails?

@user1980 Try this-


return $this->view('emails.myDemoMail')
            ->attach(public_path('pdf/sample.pdf'), [
                 'as' => 'sample.pdf',
                 'mime' => 'application/pdf',
            ])->attach(public_path('other/file/type.dox')
            ])->attach(public_path('other/file/type.ppt');

Check more: https://laravel.com/api/8.x/Illuminate/Mail/Mailable.html#method_attach

Community Pillar

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