tomopongrac

tomopongrac

Member Since 4 Years Ago

Croatia

Experience Points 282,720
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 993
Lessons
Completed
Best Reply Awards 424
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.

06 Jun
2 weeks ago

tomopongrac left a reply on 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

05 Jun
2 weeks ago

tomopongrac left a reply on Select Inputs Ignored By Validation

Try to remove disabled attribute

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

tomopongrac left a reply on Laracasts Subscription Problem

Are you login in on your phone?

tomopongrac left a reply on 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

04 Jun
3 weeks ago

tomopongrac left a reply on 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

29 May
3 weeks ago

tomopongrac left a reply on Map Array Values To Collection Of Items

You can try

$items->mapWithKeys(function ($item) {
    return [
            $baseMap['name'] => $item['name'],
            $baseMap['year'] => $item['year'],
        ];
});

tomopongrac left a reply on "Class 'App\Http\Controllers\FetchPostsfromBlog' Not Found"

Did you try with

composer dump-autoload
28 May
4 weeks ago

tomopongrac left a reply on Axios

Check the documentation

https://github.com/axios/axios

25 May
1 month ago

tomopongrac left a reply on Syntax Error In Laravel Controller

You need to name your class "Class" differently

24 May
1 month ago

tomopongrac left a reply on Function () Does Not Exist

Try

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

tomopongrac left a reply on 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
21 May
1 month ago

tomopongrac left a reply on 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 = false;
                }
               }

       });
13 May
1 month ago

tomopongrac left a reply on Eloquent Query Where Post Has No Comments

$postsWIthoutComments = Post::has('comments', '=', 0)->get();
25 Mar
3 months ago

tomopongrac left a reply on Valid Condition In Blade Form Input

Try

old('common_settings_site_name', $common_settings_site_name)
22 Mar
3 months ago

tomopongrac left a reply on Why Do I Need To Use Extends Contoller?

Because you get additional functionality which you can use in your controllers like validation.

21 Mar
3 months ago

tomopongrac left a reply on 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'

tomopongrac left a reply on [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

tomopongrac left a reply on [5.7.11] Auth And Session Data

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

tomopongrac left a reply on 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

20 Mar
3 months ago

tomopongrac left a reply on Uncaught Error: Syntax Error, Unrecognized Expression:

What do you get with

console.log(module_id);
01 Mar
3 months ago
19 Feb
4 months ago

tomopongrac left a reply on How To Get All The Data From My Database

Do you get any results with this query

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

tomopongrac left a reply on 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'));
15 Feb
4 months ago

tomopongrac left a reply on Route Isn't Working

Do you have middlesware admin?

I think that you only need auth middleware

tomopongrac left a reply on Route Isn't Working

Remove /admin from route

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

tomopongrac left a reply on Undefined Variable: Inputs

Did you pass $input parametar when you call send method ... it looks that you pass token parametar

tomopongrac left a reply on 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);

tomopongrac left a reply on Get Number Of Week Day In Carbon

Does this work

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

tomopongrac left a reply on != Or <> Does Not Work In @if

What are the value of $variable becase that should work

tomopongrac left a reply on Laravel 5.7 : Unable To Test Patch/Put/Delete Routes

You need to create row in database with create()

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

tomopongrac left a reply on About Closures

In line

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

you override variable $keyBy and value become closure function

tomopongrac left a reply on 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);
    }

tomopongrac left a reply on About Closures

Try

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

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

tomopongrac left a reply on Form Submit Not Working

Try to use lower case in route

Route::resource('message','MessageController');
08 Feb
4 months ago

tomopongrac left a reply on Syntax Error, Unexpected '" Class="' (T_CONSTANT_ENCAPSED_STRING), Expecting ',' Or ';'

Try to clear cache

php artisan view:clear
php artisan cache:clear

tomopongrac left a reply on 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);
}
07 Feb
4 months ago

tomopongrac left a reply on Fetching Full Name From Model

Try

$supervisors = Employeedetail::where(['status'=>'Active'])->get();

foreach ($supervisors as $supervisor) {
    echo $supervisor->full_name;
}

tomopongrac left a reply on Submitting The Form To Show Old Empty Value In Validation Error

Try this

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

tomopongrac left a reply on Using Select Blade

Add all() method

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