tisuchi

tisuchi

Software Engineer at Avana

Kuala Lumpur

Member Since 3 Years Ago

Experience Points 354,815
Experience
Level
Lessons Completed 1378
Lessons
Completed
Best Reply Awards 211
Best Answer
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.

07 Dec
4 days 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
1 week 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
2 weeks ago

tisuchi left a reply on Form Validation In Select Box

@sanjayacloud

Try with this rule-

'governmentHospitals'  => 'required|array|min:1',
21 Nov
2 weeks 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
3 weeks 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
3 weeks 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
1 month 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

tisuchi left a reply on Get Total Amount Of Users.

Have you tried this?

$user = User::get();

$user->count();

This will return the total number of users.

07 Nov
1 month ago

tisuchi left a reply on Profiler For Laravel 5.2+

@jkocik

It's really a handy package. I will give a try. :)

tisuchi started a new conversation Regarding The New Design

Hello @jeffreyway

Thank you for a nice and clean design. I was really excited to see your new design since you announced about the new design. Now everything looks very elegant.

However, I have noticed that there are few issues already detected by some other community people. Hope you will fix and make it more user-friendly.

Love Laracasts.

tisuchi left a reply on Laravel Project

@gayann

You have to make sure that you have a login route.

06 Nov
1 month ago

tisuchi left a reply on Laravel Project

@gayann

Why not simply run your localhost and navigate to your project folder/public?

For example, if you use xampp and your project folder name is blog, you should able to use like that way in the browser-

localhost/blog/public

It should return you the project.

tisuchi left a reply on SQLSTATE[HY000]: General Error: 1364 Field 'image' Doesn't Have A Default Value

@jsanwo64

I think you forgot to add enctype="multipart/form-data" in form. That's why the image is missing.

Try after updating your form like that way-

<form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" action="/admin/hotels/create-room-type" method="post" enctype="multipart/form-data">

tisuchi left a reply on Get All Sizes And Their Count

@adnan483

You can try this-

ProductAttributes::->selectRaw('count(size) totalSize, *')
        ->distinct('size')
        ->get();
05 Nov
1 month ago

tisuchi left a reply on How To Fetch Records From Various Tables Using Foreign Key In Laravel?

@AbdulBazith

You need to define the relationships and adjust the name based on your relationships.

Please read this doc. https://laravel.com/docs/5.7/eloquent-relationships#defining-relationships

Besides that, you can watch this video- https://laracasts.com/series/laravel-from-scratch-2018/episodes/16

tisuchi left a reply on Loading Same Id All Time

Why not you simply pass the id as a parameter of addProductPricing().

For example-

<a onclick="addProductPricing({{ $customer->id }})" id="addP">Add</a>

Now-

<script type="text/javascript">
            function addProductPricing(customerId) {

               $('#productPricing').modal('show');
                alert(customerId);

            };
</script>

tisuchi left a reply on How To Fetch Records From Various Tables Using Foreign Key In Laravel?

It should be like that-

//return username from users table
$user->name;  


// return education from the education_details table
$user->educationDetails->education;


// return lang_name from the language_details table
$user->languageDetails->lang_name;


// return certificate_title from the certificationDetails table
$user->certificationDetails->certificate_title;

Read More: https://laravel.com/docs/5.7/eloquent-relationships#defining-relationships

tisuchi left a reply on The Only Supported Ciphers Are AES-128-CBC And AES-256-CBC With The Correct Key Lengths.

@prasad_RS

You need to have .env on your appication folder then run:

$ php artisan key:generate

If you don't have .env copy from .env.example:

$ cp .env.example .env

Check More: https://stackoverflow.com/questions/39693312/the-only-supported-ciphers-are-aes-128-cbc-and-aes-256-cbc-with-the-correct-key

03 Nov
1 month ago

tisuchi left a reply on How To Fetch Records From Various Tables Using Foreign Key In Laravel?

You can apply simply where() on the Model.

$user = User::where('id', 1)
        ->with(['educationDetails', 'languageDetails', 'certificationDetails'])
        ->first();

tisuchi left a reply on How To Fetch Records From Various Tables Using Foreign Key In Laravel?

Why not just establish a relationship among as follows-

  • A User has two education_Details
  • A User has two language_details
  • A User has two certification_details

Then simply you can fetch user like that way-

$user = User::with('educationDetails', 'languageDetails', 'certificationDetails')->first();
02 Nov
1 month ago

tisuchi left a reply on "Include" One Function Into Another In Controller?

You should able to do this-


public function functionOne(){
    // write your logic
}


public function anotherFunction(){
    // Calling functionOne()
    $this->function();
}
30 Oct
1 month ago

tisuchi left a reply on Convert Multiple Array Into A String In Laravel

Have you tried ```pluck()`` @Chitrasen ?

For example-

return Establishments::where('status',0)->where('city','=',$data['location'])->pluck('id'); 

tisuchi left a reply on How I Can Write Where Condition On Blade Template

  • The general rule of Thum is, never put your logical code in the view.

The best way, I suggest you apply Query Scope for that.

Referece: https://laravel.com/docs/5.7/eloquent#query-scopes

tisuchi left a reply on How Can I Convert Into Laravel?

@bevA I haven't tested it yet. You may try code like this way-

$lists = Authorlist::where(function($query){
    foreach(range('a', 'z') as $i){
        $query->orWhere('name', 'like',  $i .'%');
    }
})->limit(30)->get();
28 Oct
1 month ago

tisuchi left a reply on Upload A Laravel 5.7 Project On Webserver Cpanel

@ioanandrei

I believe for the subdomain, you need to put public folder contents are into subdomain folder. I haven't tested it yet, but literally it should work.

tisuchi left a reply on Upload A Laravel 5.7 Project On Webserver Cpanel

You need to adjust some setting in your file. I recommend you to watch this- https://www.youtube.com/watch?v=pBTvXKGvrAA

tisuchi left a reply on Page Has Expired Due To Inactivity

@ganeshkhadka

It's a cache issue then.

For future reference, I just add some command here.

composer dump-autoload
php artisan optimize
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear

tisuchi left a reply on Generate A URL From Database To Blade

@auroralabs

Actually this is the error.

href="{{ route('{{ $accommodation->url }}') }}

It should be like that-

<a title="{{ $accommodation->title }}" itemprop="url" href="{{ route($accommodation->url) }}">
26 Oct
1 month ago

tisuchi left a reply on Best Practice To Store Additional User Information

In terms of scalability, yes, you better separate user additional information. It will be easy to scale your application.

I believe it's standard in your industry now.

24 Oct
1 month ago

tisuchi left a reply on Storing Data Files Into Laravel App

Check this episode https://laracasts.com/series/laravel-from-scratch-2017/episodes/11

Of course, I suggest you watch the entire series.

tisuchi left a reply on How I Can Convert My Query Into Eloquent

Your query is not readable. You better use ``` before and after your code to make it other's readable.