Sergiu17

Sergiu17

Member Since 2 Years Ago

Chisinau

Experience Points
308,710
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
1516
Lessons
Completed
Best Reply Awards
239
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
308,710 XP
Nov
21
1 day ago
Activity icon

Replied to Redirect To Specify Blade In Laravel Issue

@alinawaz

axios.post('/untyme/public/payPalPayment',formData)
.then(function (resp) {
    console.log(resp.data); // HERE YOU CAN SEE THE RESPONSE ( IN THE CONSOLE )
}).catch(function (resp) {
    console.log(resp); // if there are some errors
});
Activity icon

Replied to Redirect To Specify Blade In Laravel Issue

Here is the deal, when you send an AJAX Request, you can't return a view.

instead, return a JSON response

return [$site_url, $business_email, $package_title, $price, $credits, $custom];

or you may also define keys for each variable, like:

return [
    'site_url' => $site_url,
    'business_email' => $business_email
    // and so on
]
Nov
20
2 days ago
Activity icon

Awarded Best Reply on Multiple Images Gallery

@cosminandrei hmm, not sure it's null when your save to $images variable. ok

foreach($request->image_salons as $image) {
    // ...
}
Activity icon

Replied to Multiple Images Gallery

@cosminandrei hmm, not sure it's null when your save to $images variable. ok

foreach($request->image_salons as $image) {
    // ...
}
Activity icon

Replied to Multiple Images Gallery

OK, take small steps,

public function upload(Request $request) {
    dd($request->all());
}

If it doesn't include image_salons, check your HTML, check if it's the correct route

Activity icon

Replied to Multiple Images Gallery

@cosminandrei try to debug a little bit

$images = $request->input('image_salons');

dd($images); // Here should be all the selected images
Activity icon

Replied to Json 2 Table

what are your trying to achieve?

Activity icon

Replied to Multiple Images Gallery

@cosminandrei yep, add multiple attribute to your input

<input type="file" name="image_salons[]" class="form-control" multiple>

also you have to change your validation rules

$this->validate($request, [
    'image_salons' => 'required'
    'image_salons.*' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
]);
// this translates to:
// - image_salons filed is required
// - every item of image_salons array should be an image, max 2048 and jpeg, png, jpg, gif or svg format.

hope it helps, and will work without errors

Activity icon

Replied to Multiple Images Gallery

Hi @cosminandrei. first of all, your input should be an array

<!-- note square brackets after image_salons -->
<input type="file" name="image_salons[]" class="form-control">

then, exactly your code wrapped in a foreach loop

$images = $request->input('image_salons'); // array

foreach($images as $image) {
    $input['image_salons'] =
    time() . '.' . $image->getClientOriginalExtension();

    $image->move(public_path('images/salons'), $input['image_salons']);

    SalonsImageGallery::create($input);
}
Nov
19
3 days ago
Activity icon

Replied to Sort By Created_at

class Ticket extends Model
{
    public function activity()
    {
        return $this->hasMany(Activity::class)->orderBy('created_at', 'asc / desc');
    }
Nov
15
1 week ago
Activity icon

Replied to Save A Thread

Nov
12
1 week 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
2 weeks 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
2 weeks 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
2 weeks 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
3 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
4 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
4 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
1 month 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
1 month ago
Activity icon

Replied to Reducing Laravel Queries (count())

use GROUP BY current_level

Oct
20
1 month 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