tomopongrac

tomopongrac

Member Since 4 Years Ago

Croatia

Experience Points
286,450
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
1019
Lessons
Completed
Best Reply Awards
425
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

Level 50
286,450 XP
Oct
15
2 days ago
Activity icon

Replied to Model Update: How To Check If There Is Changes ?

You have method isDirty()

if($task->isDirty()){
    // the tash has been edited
}
Sep
25
3 weeks ago
Activity icon

Replied to How To Use Log::info()

Does it work when you put log to beginning

public function contactUssend(Request $request){

    Log::info('Hello World'); // <----

    if($request->method() == 'POST'){
        if($request->ajax()){
            if( $request->post('human_verify') == Session::get('humanverify')){  
                $confirmation = Mail::send(new ContactUs($request));                    
                if($confirmation){
                    return response()->json(['result' => 1]);  
                }
                else {
                    return response()->json(['result' => 0]);  
                }
            }else {
            
                return response()->json(['result' => 2]);
            }
        }
    } else { 
        return response()->json(['result' => 0]); 
    }
}
Activity icon

Replied to How To Get Only The Minimum Value ?

Or you can this

return taskStatus::whereIn('id', [3,5,6,7,1,2])->orderBy('order')->first();
Activity icon

Replied to Help With A Model Function

Try this

public function opened(){

        foreach ($this->timings() as $timings){
            if ($timings->day == "Wednesday"){
                return true;
            }
        }

        return false;

    }
Sep
23
3 weeks ago
Activity icon

Replied to MySQL 5.7 Has Gone Away

In terminal type this command to find where is my.cnf file is

mysql --verbose --help | grep my.cnf

Then in my.cnf file add this to change max_allowed_packet

max_allowed_packet = ???

and then you need to restart mysql

Activity icon

Replied to MySQL 5.7 Has Gone Away

I think that you need to increase max_allowed_packet because the largest possible packet that can be transmitted 1GB

https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

Sep
15
1 month ago
Activity icon

Replied to RouteKeyName With Name->Routes

Try this

{{route('product.single.public', [$product, $category])}}

https://laravel.com/docs/5.8/helpers#method-route

Jun
06
4 months ago
Activity icon

Replied to Stop The Loop From Repeating Categories

Try collection method groupBy like this

<?php $grouped = $artist->groupBy('type'); ?> 
@foreach($grouped as $type => $albums)
    
    <div>{{ $type }}</div>


    @foreach($albums as $type => $album)
            {{$album->title}} - {{$album->year}}
    @endforeach

@endforeach

https://laravel.com/docs/5.8/collections#method-groupby

Jun
05
4 months ago
Activity icon

Replied to Select Inputs Ignored By Validation

Try to remove disabled attribute

<option selected value="">Male or Female? </option>
Activity icon

Replied to Laracasts Subscription Problem

Are you login in on your phone?

Activity icon

Replied to Sweet Alert

Try with persistent method

// -> The text will appear in the button
alert('Hello World!')->persistent("Close this");

https://github.com/uxweb/sweet-alert

Jun
04
4 months ago
Activity icon

Replied to Chaining Fresh() In Model Methods For Test To Pass

That is ok because sometimes you need to get new model from the database in order to pass the test

May
29
4 months ago
Activity icon

Replied to Map Array Values To Collection Of Items

You can try

$items->mapWithKeys(function ($item) use ($baseMap) {
    return [
            $baseMap['name'] => $item['name'],
            $baseMap['year'] => $item['year'],
        ];
});
May
28
4 months ago
Activity icon

Replied to Axios

Check the documentation

https://github.com/axios/axios

May
24
4 months ago
Activity icon

Replied to Function () Does Not Exist

Try

Route::get('/mobileServices', function (){
    Alert::message('Welcome back!');
})->name('mobileServices');

https://laravel.com/docs/5.8/routing#named-routes

May
22
4 months ago
Activity icon

Replied to How To Change PHP Version In Homestead

Connect to homestead with ssh

vagrant ssh

and write command bellow

php56

if you want php 7.3 again write this command

php73
May
21
4 months ago
Activity icon

Replied to Change Data From Another Vue Element

Try

<script>
        vm = new Vue({
            el: '#flashMessage',

            data: {
                show: false
            }
        });

    @if($thread->hasReplies())
       vm1 = new Vue({
            el: '#dropdown-vue',

           methods: {
                destroy() {
                    axios.delete('/replies/{{$reply->id}}/delete');
            vm.show = true;
                }
               }

       });
May
13
5 months ago
Mar
25
6 months ago
Activity icon

Replied to Valid Condition In Blade Form Input

Try

old('common_settings_site_name', $common_settings_site_name)
Mar
21
6 months ago
Activity icon

Replied to Method Illuminate\Validation\Validator::validateRequired|date|before Does Not Exist.

Try

'start_date'    => 'required|date|before:' . Carbon\Carbon::now(),
'end_date'      => 'date|before:start_date'

or

'start_date'    => ['required', 'date', 'before:' . Carbon\Carbon::now()],
'end_date'      => ['date', 'before:start_date']
Activity icon

Replied to [5.7.11] Auth And Session Data

if on other machine FOFO user is authenticated you get his data, if you authenicate with TOTO credetials you will get his data

Activity icon

Replied to [5.7.11] Auth And Session Data

I dont understand the problem because auth()->user() gets the user which is authenticated

Activity icon

Replied to File Validation Not Working Properly

You only need to define mimes rule because this rule actually validates against the MIME type of the file by reading the file's contents and guessing its MIME type

https://laravel.com/docs/5.8/validation#rule-mimes

Mar
20
6 months ago
Activity icon

Replied to Uncaught Error: Syntax Error, Unrecognized Expression:

What do you get with

console.log(module_id);
Mar
01
7 months ago
Feb
19
7 months ago
Activity icon

Replied to How To Get All The Data From My Database

Do you get any results with this query

$levels = Category::all();
dd($levels);
Activity icon

Replied to How To Get All The Data From My Database

Do you get any results from database

$levels = Category::where(['parent_id'=>0])->get();
dd($levels);

        return view('admin.categories.add_category')->with(compact('levels'));
Feb
15
8 months ago
Activity icon

Replied to Route Isn't Working

Do you have middlesware admin?

I think that you only need auth middleware

Activity icon

Replied to Route Isn't Working

Remove /admin from route

Route::get('dashboard','[email protected]')->name('dashboard');
Feb
13
8 months ago
Activity icon

Replied to Get Number Of Week Day In Carbon

You can with this

    $strArray = [];
    for($i = 0; $i<7; $i++){
        $strArray[] = Carbon::now()->addDays($i)->dayOfWeek;
    }
    
    $str = implode(',', $strArray);
Activity icon

Replied to Get Number Of Week Day In Carbon

Does this work

$dayOfTheWeek = Carbon::now()->dayOfWeek;
Feb
11
8 months ago
Activity icon

Replied to Laravel 5.7 : Unable To Test Patch/Put/Delete Routes

You need to create row in database with create()

$timesheet = factory(Timesheet::class)->create();
Activity icon

Replied to About Closures

In line

$keyBy = $this->valueRetriever($keyBy);

you override variable $keyBy and value become closure function

Activity icon

Replied to About Closures

This is the source code of method keyBy

    public function keyBy($keyBy) {
        $keyBy = $this->valueRetriever($keyBy);

        $results = [];

        foreach ($this->items as $key => $item) {
            $resolvedKey = $keyBy($item, $key); // <--- check this

            if (is_object($resolvedKey)) {
                $resolvedKey = (string) $resolvedKey;
            }

            $results[$resolvedKey] = $item;
        }

        return new static($results);
    }

It is like this code

    class hello {
            function get($value){
                return function ($item) use ($value) {
                    dd($item);
                    return $value;
                };
            }
        }

        $hello = new hello;
        $variable = $hello->get("hello");
        $variable('hello_item');
Activity icon

Replied to About Closures

Try

class hello {
        function get($value){
            return function ($item) use ($value) {
                    dd($item);
                    return $value;
                };
        }
    }

    $hello = new hello;
    var_dump($hello->get("hello")("hello_item"));
Activity icon

Replied to Form Submit Not Working

Try to use lower case in route

Route::resource('message','MessageController');
Feb
08
8 months ago
Activity icon

Replied to Passing The Same Variables To Multiple Views Over And Over Again

What you get with this

public function boot() {

    $menu = MainMenu::OrderBy('Order', 'asc')->get();
    $cat = Category::OrderBy('sortOrder', 'asc')->get();

    $data = array(
        'main_menus' => $menu,
        'categories' => $cat,
    );

dd($data);

    View::share('data', $data);
}
Feb
07
8 months ago
Activity icon

Replied to Submitting The Form To Show Old Empty Value In Validation Error

Try this

value="{{ old('field_name', ( isset($dbRow) ? $dbRow->field_name : '')) }}"
Activity icon

Replied to Using Select Blade

Add all() method

$holidayCalenders = Holidaycalander::where(['status'=>'on'])->pluck('name','id')->all();

https://laravel.com/docs/5.7/collections#method-pluck