tomopongrac

tomopongrac

Member Since 4 Years Ago

Croatia

Experience Points 259,730
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 814
Lessons
Completed
Best Reply Awards 416
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.

15 Feb
1 day 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
3 days 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
5 days 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
1 week 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
1 week 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
1 week 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 weeks 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 weeks 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 weeks ago
28 Jan
2 weeks 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';

tomopongrac left a reply on Composer Very Slow On Windows

Does xdebug is enabled on your windows machine?

tomopongrac left a reply on Photos Belonging To A Specific Position In The Row

In show.blade.php remove brackets after photos

<div class="thumbnail">
     <h3>{{ $education->title }}</h3>
           <div class="caption">     
                      <p>{!! $education->description !!}</p>
           </div>                    
           @foreach($education->photos as $photo)
           {{ $photo->filename }}
           @endforeach
</div>
25 Jan
3 weeks ago
16 Jan
1 month ago

tomopongrac left a reply on WhereNull Is Not Working

Try output raw query

$movement_detail = DB::table('a_movements')
        ->join('a_movement_locations',function ($join){
            $join->on('a_movements.id','=','a_movement_locations.movement_id');
            $join->where('a_movement_locations.location_type','=','Unit');
        })
        ->join('units','a_movement_locations.to_location','=','units.id')
        ->join('service_life_events','a_movements.svc_life_event_id','=','service_life_events.id')
    ->whereNull(a_movements.deleted_at')
        ->where([['a_movements.army_id','=',$a_id],['service_life_events.name','=','Permanent   Posting']])
        ->orWhere([['a_movements.army_id','=',$a_id],['service_life_events.name','=','b_Posting']])
        ->orWhere([['a_movements.a_id','=',$army_id],['service_life_events.name','=','a_Posting']])
        ->select('*')
        ->orderBy('start_date','asc')
        //->get();
    ->toSql();

dd($movement_detail);
15 Jan
1 month ago

tomopongrac left a reply on Validate Dropdown Values

You have validation rule exists ... check the documentation

https://laravel.com/docs/5.7/validation#rule-exists

tomopongrac left a reply on Facebook Preview Not Working Coreectly

If you provide og:image meta tag you can choose which image facebook should show

http://ogp.me

tomopongrac left a reply on Facebook Preview Not Working Coreectly

Did you try to check link in facebook sharing debugger

https://developers.facebook.com/tools/debug/sharing/

tomopongrac left a reply on How Can I Add Queries To An Instance Of A Model Without Using It Right Away?

Try

$results = MyModel::get(['field1',field2',field3']);
14 Jan
1 month ago

tomopongrac left a reply on How To Split Long Words In Two If They Are Greater Than 15characters

What output do you want?

$text = 'idshfusdgfuysdgfusydgfuydsfisudytfsduiytfgsdiyfgsduytgsduytfsdiuygsduyfgsdyfgsdyogisydgsydfsd';

echo wordwrap($text, 20, "\n", true);

/* Output
idshfusdgfuysdgfusyd
gfuydsfisudytfsduiyt
fgsdiyfgsduytgsduytf
sdiuygsduyfgsdyfgsdy
ogisydgsydfsd
*/

tomopongrac left a reply on Where Are All The Functions Of "Model"

select() method is in class Builder which namespace is Illuminate\Database\Query

15 Nov
3 months ago

tomopongrac left a reply on Undefined Index - But Index Is Present

What do you get when you var_dump $result

$response = urldecode($response); $result = array(); parse_str($response, $result);

dd($result);

return array('month' => $month, 'rate' => $result['rate'], // this is where the script crashes 'ssv' => $result['ssv']);

11 Oct
4 months ago

tomopongrac left a reply on TokenMismatchException

You must define token in your form

More details you have in documentation

https://laravel.com/docs/5.7/csrf#csrf-introduction