Sergiu17

Sergiu17

Member Since 2 Years Ago

Chisinau

Experience Points
307,870
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
1514
Lessons
Completed
Best Reply Awards
238
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
307,870 XP
Nov
15
3 days ago
Activity icon

Replied to Save A Thread

Nov
12
6 days ago
Activity icon

Replied to Mock Nightmare

https://i.imgur.com/jSdSRxi.png

https://i.imgur.com/NsS7bOZ.png

There are two classes..

testing function from TryingMock class is called in other class, which you don't have ( second image )

Activity icon

Awarded Best Reply on Undefined Variable: Uid1

Second parameter to the send function is data

Mail::send(
    'mail.email',
    ['name' => 'PG-MANAGMENT', 'uid1' = $uid1],
    function($message) use ($uemail) {
        $message->to($uemail);
    }
Activity icon

Replied to Undefined Variable: Uid1

Second parameter to the send function is data

Mail::send(
    'mail.email',
    ['name' => 'PG-MANAGMENT', 'uid1' = $uid1],
    function($message) use ($uemail) {
        $message->to($uemail);
    }
Nov
11
1 week ago
Activity icon

Replied to General Error: 1364 Field 'first_name' Doesn't Have A Default Value

@masumluf I don't get it. You have your values in store method ( $request->all() )

And you want password before submitting? Where? In Vue? or?

Activity icon

Replied to General Error: 1364 Field 'first_name' Doesn't Have A Default Value

Probably because of the $fillable array in your model,

https://github.com/masumluf/ourschool/blob/master/app/Model/Student.php#L28

try to add first_name in array

Nov
08
1 week ago
Activity icon

Replied to Accessing .tag In PHP Variable

Hi, so what is $dropbox_file? an object or an array?

$dropbox_file->id   // object
$dropbox_file->name // object
$dropbox_file->size // object
$dropbox_file[".tag"] // array
Nov
07
1 week ago
Activity icon

Replied to How To Disable Throttle Or Rate Limiter ?

use Illuminate\Foundation\Testing\WithoutMiddleware;

class ExampleTestClass extends TestCase
{
    use WithoutMiddleware;

    public function exampleTestMethod()
    {
        $this->withoutMiddleware();

        // your test 
    }
}
Nov
06
1 week ago
Activity icon

Replied to Laravel Email Verfication Return Error When Try To Resgiter

change MAIL_DRIVER to log, or go to mailtrap.io, create an account, and update MAIL_USERNAME, MAIL_PASSWORD and MAIL_ENCRYPTION in your env file

Activity icon

Replied to Delete Button Not Functioning

What doesn't work? It doesn't submit? it doesn't delete?

Oct
31
2 weeks ago
Activity icon

Replied to Update Boolean Via Controller

Do you send any values to the controller?

public function active(Request $request, $id)
{
    dd($request->all()); // do you have something here?

    // Since your method is called active
    $cake->active = true;
    $cake->save();
}
Oct
25
3 weeks ago
Activity icon

Replied to Laravel And Vendor

https://getcomposer.org/doc/06-config.md#vendor-dir in composer.json file you can specify install directory

{
    "config": {
        "vendor-dir": "/var/www"
    }
}
Oct
23
3 weeks ago
Activity icon

Replied to List All Table In Database

Found on stackoverflow - https://stackoverflow.com/questions/33478988/how-to-fetch-the-tables-list-in-database-in-laravel-5-1

$tables = DB::select('SHOW TABLES');
foreach($tables as $table)
{
      echo $table->Tables_in_db_name;
}
foreach ($tables as $table) {
    foreach ($table as $key => $value)
        echo $value;
}
Activity icon

Replied to Eloquent : Return Only Some Attributes Instead Of All

public function participants()
{
    return $this->belongsToMany(User::class, 'participants_training')->select(['name']);
}

@nakov do you sleep dude? :D

Oct
22
3 weeks ago
Activity icon

Replied to Show Pdf File Before Download

@bekaskaki please note, that this will work only for you and people with settings to display PDFs, instead of download them.

Activity icon

Awarded Best Reply on Show Pdf File Before Download

I'm not quite sure, but this is about browser settings, I always can set to automatically to download or preview specific types of files in the browser

Firefox: https://i.imgur.com/1LQIEj5.png

Activity icon

Replied to Show Pdf File Before Download

I'm not quite sure, but this is about browser settings, I always can set to automatically to download or preview specific types of files in the browser

Firefox: https://i.imgur.com/1LQIEj5.png

Activity icon

Replied to ErrorException (E_WARNING) Count(): Parameter Must Be An Array Or An Object That Implements Countable

What do you want to count? admin::where('email',$request->email)->first();

First admin?

Use firstOrFail()

Oct
21
4 weeks ago
Activity icon

Replied to Reducing Laravel Queries (count())

use GROUP BY current_level

Oct
20
4 weeks ago
Activity icon

Awarded Best Reply on Learning Paths

Hi, https://laracasts.com/skills/php

  • The PHP Practitioner
  • Object-Oriented Bootcamp
  • PHP 7 Up and Running
  • What's New in PHP 7.1

and so one.

Lessons are ordered from basic to advanced.

Oct
17
1 month ago
Activity icon

Replied to Laravel Route Model Binding Is Not Working,

Route::verb('/url/{wildcard}', '[email protected]');

public function method(Model $wildcard) {}

Those two highlighted must match

Activity icon

Replied to Model Realtion Wont Save In Elastic

Never used scout, but, what I can see: you cast your model into an array, but you do not cast your relation.

$array['city'] => $this->city()->toArray(); // not sure but, give a try
Oct
15
1 month ago
Activity icon

Replied to Multi Image Upload Not Working

@mattb also, I suggest you to rename photo_id column into game_id in photos table.

Activity icon

Replied to Multi Image Upload Not Working

@mattb maybe $game->id, instead of $request->id ?

$image->photo_id = $game->id;
Activity icon

Replied to Multi Image Upload Not Working

{!! Form::file('image[]', null, ['class'=>'form-control'])!!}

add this square brackets. and also, you always could do dd($request->file('image')) before passing it to foreach loop

Activity icon

Replied to Show If Checkbox Is Checked Or Unchecked In Edit View

@bekaskaki works for me, have no clue why doesn't work for you.

Activity icon

Replied to Show If Checkbox Is Checked Or Unchecked In Edit View

<input
    type="checkbox"
    name="bidang[]"
    value="Pendidikan"
    {{ (is_array(old('bidang')) && in_array('Pendidikan', old('bidang'))) ? ' checked' : '' }}
/>
Activity icon

Replied to Hidden Field Value Not In Request Parameters

Trigger the checkLocationInput function when you submit

Oct
14
1 month ago
Activity icon

Replied to Php Function Argument Passing Error

Your code looks OK, you may miss something. Is your code in the same file?

<?php 
// index.php
$persons = array ("p1", "p2","p3","p4");

function mypersons($persons) { 
    foreach ($persons as $key => $value) {
        echo "<li>$value</li>";
    }
}

mypersons($persons);

Oct
11
1 month ago
Activity icon

Replied to Git Bash Changed Migartion Output "?[33mMigrating:?[39m"

It tries to make Migrating in red, and Migrated in green, but terminal doesn't support colors

pa migrate:fresh --seed --no-ansi

add --no-ansi flag

Oct
10
1 month ago
Activity icon

Replied to Learning Paths

Hi, https://laracasts.com/skills/php

  • The PHP Practitioner
  • Object-Oriented Bootcamp
  • PHP 7 Up and Running
  • What's New in PHP 7.1

and so one.

Lessons are ordered from basic to advanced.

Oct
08
1 month ago
Activity icon

Replied to Laravel Project Unable To Run Locally

composer install ?

Oct
06
1 month ago
Activity icon

Replied to Filter OneToMany Relation When Searching

Hi, probably because at the end you have ->with('Person')

your query should be something like this

$card = Card::whereHas('Person', function ($query) use ($value) {
        $query->where('name', $value)
    })->get();
Activity icon

Replied to Database Connection

if you are running Linux or Mac

sudo chmod 777 config/database.php

Oct
05
1 month ago
Activity icon

Replied to Help Me Cant Extends The User

In route model binding, wildcard and parameter from the function, must match. Examples:

Route::get('/admin/{id}', '[email protected]');
public function show(User $id)
Route::get('/admin/{user}', '[email protected]');
public function show(User $user)
Route::get('/admin/{admin}', '[email protected]');
public function show(User $admin)

All above examples works

Oct
03
1 month ago
Activity icon

Replied to What Is The Meaning Of <a Href = "/forum?filter=me"

You are sending a parameter to the request called filter and it's value is me

In your controller you can do:

public function index(Request $request)
{
    dd($request->input('filter'));
}
Oct
01
1 month ago
Activity icon

Replied to Combination Of Two Column Must Unique

@untymage ohh, sorry. I think that this could be done only with validation as MikeMacDowell mentioned

Activity icon

Replied to Combination Of Two Column Must Unique

$table->unique(['column1', 'column2']);
Sep
30
1 month ago
Sep
29
1 month ago
Activity icon

Replied to ES6 Export And Import Not Working

Compile your code and everything will be fine, you could use Webpack or Browserify

Google a little for more details, basically this is because require() does not exist in the browser JavaScript.

Activity icon

Replied to Laravel | Remove File From Storage After Deleting The Row

@ziben69 start debugging, the problem could be in the path, add some dumps or even dd() function

foreach($subpage->documents() as $document) {
    dd('public/documents/' . $document->filename); // check if this is the correct path

Activity icon

Replied to Laravel | Remove File From Storage After Deleting The Row

Hi again!

foreach($subpage->documents() as $document) {
    if(file_exists('public/documents/' . $document->filename) {
        unlink('public/documents/' . $document->filename);
    }
}

$subpage->documents()->delete();
Activity icon

Replied to Laravel | File Upload. Problem With Saving Into Database

@ziben69 take second approach, with time() function or uniqid() or any other function to generate random names..if two persons upload two images with the same name for example image.png, you'll end up losing images, php will replace old image.

So, take second approach with time function

Activity icon

Replied to Laravel | File Upload. Problem With Saving Into Database

foreach ($request->documents as $document) {

    // $document, not $request->documents
    $filename = 'filename'.time().'.'.$document->getClientOriginalExtension();

    // once again, $document, not $request->documents
    $document->storeAs('public/documents',$filename);

    Document::create();
}