tomopongrac

tomopongrac

Member Since 4 Years Ago

Croatia

Experience Points 266,750
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 866
Lessons
Completed
Best Reply Awards 419
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.

25 Mar
1 month ago

tomopongrac left a reply on Valid Condition In Blade Form Input

Try

old('common_settings_site_name', $common_settings_site_name)
22 Mar
1 month 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
1 month 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
1 month ago

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

What do you get with

console.log(module_id);
01 Mar
1 month ago
19 Feb
2 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
2 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
2 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
2 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
2 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
2 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();

tomopongrac left a reply on Urgent Help Needed, Even Google Couldn't Answer- Please Help. Laravel Test Fails..

Try to create password grant before login user

//create password grant client
  $this->artisan('passport:client', ['--password' =>true, '--no-interaction' => true, '-- 
  redirect_uri'=>'http://localhost', '--name'=>'test client']);
  // fetch client for id and secret
  $client = \DB::table('oauth_clients')->where('password_client', 1)->first();

$user= factory(User::class)->create(); //create user
$login=$this->actingAs($user,'api'); //user login with api

tomopongrac left a reply on SQLSTATE[42000]: Syntax Error Or Access Violation: 1075 Incorrect Table Definition; There Can Be Only One Auto Column And It Must Be Defined As A Key

You can not set integer length in column working_days, instead use

$table->bigInteger()
$table->mediumInteger()
$table->integer()
$table->smallInteger()
$table->tinyInteger()

https://laravel.com/docs/5.5/migrations#columns

06 Feb
2 months ago

tomopongrac left a reply on Set A Session In Laravel Blade

In RegisterController create registered method

    /**
     * The user has been registered.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  mixed  $user
     * @return mixed
     */
    protected function registered(Request $request, $user)
    {
        if ($request->session()->has('key')) {
        $sessionData = $request->session()->get('key');
            return redirect()->route('your route');
        }

        return redirect($this->redirectTo);
    }

tomopongrac left a reply on Set A Session In Laravel Blade

In your LoginController try to add this method

    protected function authenticated(Request $request, $user)
    {
        if ($request->session()->get('key')) {
            return redirect()->route('your route');
        }

        return redirect($this->redirectTo);
    }

tomopongrac left a reply on Set A Session In Laravel Blade

In controller which render your blade file put this code ... for example

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UserController extends Controller
{
    /**
     * Show the profile for the given user.
     *
     * @param  Request  $request
     * @param  int  $id
     * @return Response
     */
    public function show(Request $request, $id)
    {
        $value = $request->session()->put('key', 'value');

        //
    }
}

For more explanation check the documentation https://laravel.com/docs/5.7/session#storing-data

tomopongrac left a reply on Set A Session In Laravel Blade

You can like this

<?php
session(['key' => 'value']);
?>

but It is not recommended to do that inside blade templates, blade’s purpose is to render the view.

tomopongrac left a reply on How I Delete Data

You have defined route with get method, you need route with delete method

Route::delete('media_destroy/{media}','[email protected]')->name('media.destroy');'

tomopongrac left a reply on Plain Text / Content-Type With Notifications

Check in documentation section "Plain Text Emails"

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

You have text method

02 Feb
2 months ago

tomopongrac left a reply on Laravel 5.7 Error Message “ Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No Message”

Change action to

action="{{ route('abouts.update', ['id' => $about->id]) }}
01 Feb
2 months ago

tomopongrac left a reply on Why Cant I Reference A Model Like $record = Ucfirst($model)::findOrFail($id);

You need to add \

dd( ('App\' . ucfirst($model))::findOrFail($id));
29 Jan
2 months ago
28 Jan
2 months ago

tomopongrac left a reply on Failed To Open Stream: No Such File Or Directory In PHP

Strange, so to make clear your folder structure is like this

|index.php |includes |parentclass.int.php |newclass.int.php

tomopongrac left a reply on Failed To Open Stream: No Such File Or Directory In PHP

Try this

<?php
include __DIR__ . '/includes/parentclass.int.php';
include __DIR__ . '/includes/newclass.int.php';