tisuchi

tisuchi

Member Since 4 Years Ago

Kuala Lumpur

Software Engineer at Avana

Experience Points 360,965
Experience Level 50

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 1393
Lessons
Completed
Best Reply Awards 215
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

28 Feb
3 weeks ago

tisuchi left a reply on Laravel Passport

@faizaltkl

Normally laravel passport is token based that doesn't follow the Session.

If you really wish to use session, you may check this discussion- https://stackoverflow.com/questions/51915982/laravel-passport-set-session

18 Feb
1 month ago

tisuchi left a reply on The Page Has Expired Due To Inactivity.

Make sure that you have used csrf.

Then run the following command.

php artisan cache:clear

tisuchi left a reply on Telescope Path In Production

Laravel telescope should be used in local environment.

Telescope makes a wonderful companion to your local Laravel development environment.

ref: https://laravel.com/docs/5.7/telescope

27 Jan
1 month ago

tisuchi left a reply on Laravel "Property [id] Does Not Exist"

Why not you just use DB join()?

Alternatively, you can use laravel relationship.

26 Jan
1 month ago

tisuchi left a reply on Help With TimeZones

Have you tried timezone?

An example code be-

$rules['start_date'] = 'required|date|timezone:America/New_York|after:yesterday|after_or_equal:today';

You may get the list of the timezone here - http://php.net/manual/en/function.timezone-identifiers-list.php

25 Jan
2 months ago

tisuchi left a reply on Creating Default Object From Empty Value

@shamsul_huda

I can see the issue is in during saving data in your best_answer method. Make sure $reply returns the value. You may apply validation here.

A sample code would be-

$reply = Reply::findOrFail($id)->update([
    'best_answer' => 1
]);

In that case, you have to add best_answer in your model as fillable properties.

BTW, you can see Jeffrey's code where you can get a complete idea and code to develop a forum like laracasts. https://github.com/laracasts/Lets-Build-a-Forum-in-Laravel

tisuchi left a reply on Redirect To External Url With Form Data From Controller

What I have in my mind is to add by manipulating DOM that is somehow related with JS.

tisuchi left a reply on Redirect To External Url With Form Data From Controller

You are trying to merge redirect and form submission, that is not the same.

You may submit form data to the external website if they have API.

21 Jan
2 months ago

tisuchi left a reply on How To Make My Code Simple ?

haha... @irsyadadl

I believe with @edoc way

tisuchi left a reply on How To Make My Code Simple ?

@irsyadadl

I think you are trying to achieve this-

  • Get all the subjects
  • Get the first post of each of subject
  • Return the post title

If you have proper relationships in the database, you can just simply write this code to achieve your things-

$subjects = Subject::with('posts')->get();

Then in the view, you just use foreach() to render like so-

foreach($subjects.posts as $post){
    echo $post->title;
}

tisuchi left a reply on Sending Bulk Email Using Sendgrid

@deekshith

In that case, you may implement Laravel Queues.

https://laravel.com/docs/5.7/queues

tisuchi left a reply on 419 Session Expired

Maybe you can try with the incognito window?

Before that, can you run cache:clear command to clear your cache?

php artisan cache:clear

tisuchi left a reply on Photo Validation In Relationship

@ziben69

Of course, you need to check in the view template as well.

Try this-

@if( $bus->singlePhotoForSingleEvent() != NULL )
    <div class="post-thumb">
        <a href="{{ URL::to('business') }}"><img src="/storage/app/public/{{ $bus->singlePhotoForSingleEvent()->filename }}" alt="{{ $bus->title }}"></a>
    </div>
@else

tisuchi left a reply on Sending Bulk Email Using Sendgrid

If you try to trigger the email to 15k users in one shot, it should slow down your application performance because of triggering 15k mail and uses a high volume of memory.

So, my suggestion is to use Queueing Mail to send the email. It might be helpful for you to solve your issue.

Check more... https://laravel.com/docs/5.7/mail#queueing-mail

tisuchi left a reply on Photo Validation In Relationship

What if you just check like this way in your method?

public function singlePhotoForSingleEvent() {
    return $this->photos()->count() > 0 ? $this->photos()->first() : NULL;
}
20 Jan
2 months ago

tisuchi left a reply on How To Auth My Laravel API For My IOS App

@samuel_b

Yeah, it seems a very good tutorial.

19 Jan
2 months ago

tisuchi left a reply on How To Auth My Laravel API For My IOS App

well, my opinion is to use Passport.

The passport is laravel industry standard for Stateless API authentication nowadays. It will increase your API security.

https://laravel.com/docs/5.7/passport

tisuchi left a reply on Authentication As Activation Key

No idea how do you do that in coding.

However, you may try laravel session() to keep various step info, where you can easily get previous step information.

https://laravel.com/docs/5.7/session

tisuchi left a reply on Testing A Secure Route Laravel 5.5 NotFoundHttpException

Make sure /contact is accessible.

If everything is fine, you may try php artisan serve and use the given IP to APP_URL in the .env file.

Now run your test again.

14 Jan
2 months ago

tisuchi left a reply on Laravel API Resources Extremely Slow

If you get you correctly @wuanshu , if you have the issue of N+1. You do eager loading and notation eager loading.

In addition, you may apply subquery as well if it takes a big amount of memory. A suggestion to take a look the following articles-

13 Jan
2 months ago

tisuchi left a reply on How To Create Facades On Laravel 5.7 Package

@gathuku

Did you run?

composer dump-autoload

08 Jan
2 months ago

tisuchi left a reply on Get Nearby Places Google API

Google has nearby API to find the location near you.

Check this doc. https://developers.google.com/places/web-service/search#PlaceSearchRequests

18 Dec
3 months ago

tisuchi left a reply on Laravel Tinker Error

You better show the procedure how to insert data via tinker.

16 Dec
3 months ago

tisuchi left a reply on Mcrypt Extension For Wamp Or Xampp

You don't have to install individually mcrypt if you have installed wamp already.

Follow this instruction- https://stackoverflow.com/questions/17480402/laravel-enable-mcrypt-for-cli

15 Dec
3 months ago

tisuchi left a reply on Class App\Http\Requests\ScholarshipRequest Does Not Exist

Make sure your imported file is there.

use App\Http\Requests\ScholarshipRequest;

Also, check the namespace for that file.

12 Dec
3 months ago

tisuchi left a reply on Laravel Passport, 'personal Access' And 'password Grant'

@markotitel

Once you have migrated the passport, you may see oauth_clients table in your DB.

personal access and password grand will be stored there.

07 Dec
3 months ago

tisuchi left a reply on Join Record In Table With Another Record In Same Table

@mum

If joining two tables, just use the relationship.

Ref: https://laravel.com/docs/5.7/eloquent-relationships

However, if it is in the same table, just do like this-

Appointment::whereNull('startId')
    ->get();

It should work.

02 Dec
3 months ago

tisuchi left a reply on How To Get A Particular Route List?

@farahandev

It refers to the name of your route.

tisuchi left a reply on How To Get A Particular Route List?

@farahandev

If I get you properly, this might be helpful for you.

php artisan route:list --name="user"

Besides that, you can use some other options-

  • --method
  • --name
  • --path=
  • --reverse
  • -r
  • --sort

You can check out more there- http://tisuchi.com/posts/laravel-php-artisan-route-list-command-9

tisuchi left a reply on Why Did Not Delete DB Record In Laravel?

In your route, if you update the code like this, it should work.

Route::get('myads/{uploads}/delete', '[email protected]');
22 Nov
4 months ago

tisuchi left a reply on Form Validation In Select Box

@sanjayacloud

Try with this rule-

'governmentHospitals'  => 'required|array|min:1',
21 Nov
4 months ago

tisuchi left a reply on How To Allways Request Specific Scope When Generation Passport Token

@muragijimana

You can define your list of scopes in the AuthServiceProvider.

If anyone provides any scope that is not in the list, it will automatically return an error.

20 Nov
4 months ago

tisuchi left a reply on Trying To Get Property Of Non-object

@graffislife

Show your full code. i.e. methods of the controller, model, and view. Show table structure if possible.

19 Nov
4 months ago

tisuchi left a reply on Showing Sub Nav

@davy_yg

If you want to add delay, just simply add .delay() function.

Try this-

<script>
$(function() {
  $( "#Pages" ).click(function(e) {
    if(!$('#Pages').hasClass('subPages')) {
      $('#Pages').addClass('subPages').delay(800);
    } else {
      $('#Pages').removeClass('subPages').delay(800);
    }
  });
});
</script>

Read more: https://api.jquery.com/delay/

tisuchi left a reply on Beautiful Blog Using Markdown Inside Your Laravel App

@saleem_hadad

Seems interesting. Will give a try.

tisuchi left a reply on Elasticsearch Syntax Error With Multi Fields Search

@mstdmstd

I think you need to use " (double quote)-

Try with this code-

"bool": {
    "must": {
      "multi_match" : {
        "query": $text, 
        "type":  "cross_fields",
        "fields": [ 
           "name^4", 
           "description"
        ]
      }
    }
}
08 Nov
4 months ago

tisuchi left a reply on View [email.paid] Not Found.

@NORBERTHO - What's error you are facing now?

tisuchi left a reply on View [email.paid] Not Found.

@Norbertho

paid.blade.php should be into email folder.

tisuchi left a reply on Laravel Model::create() Not Working

@farahandev

You need to add $fillable properties in the model.

In your Shopowner model, just add the following line-

protected $fillable = ['shop_id', 'user_id', 'original_owner'];

It should work fine.

tisuchi started a new conversation Duplicate The Best Answer.

Hello @jeffreyway

I have noticed that, in some cases, the best answer shows two times. Please take a note that.

https://laracasts.com/discuss/channels/laravel/upload-a-laravel-57-project-on-webserver-cpanel?page=1#reply-467891