lavina

lavina

Member Since 10 Months Ago

Experience Points
1,720
Total
Experience

3,280 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
3
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 1
1,720 XP
Sep
21
1 month ago
Activity icon

Replied to Validation

You are definetly right sir, copy pasted the wrong input field, updated the field name to the real name : 'videos[]'

Activity icon

Started a new Conversation Validation

Hello, i have a file upload field:

<input type="file" name="videos[]" id="videos" accept="video/*" multiple>

I have controller:

    public function addVehicle(VehicleRequest $request, $category, $id)
    {
        dd($request);
}

And VehicleRequest with rules:

        return [
            'videos.*' => 'required|file|mimes:mp4,mov,og,wmv,flv,avi',
        ];

If file type is wrong, it fails validation, if lefty empty it passes, why is this happening??

Aug
14
2 months ago
Activity icon

Replied to Laravel Relationships

Yes, i have exactly that, now i would like to make user connection on it

So model Company:

public function users()
{
   return $this->hasOneThrough('App\Section', 'App\User');
}

But, section does not really have the data, because the connection is made in the intermediate table of section_user

Activity icon

Replied to Laravel Relationships

But what would be the relationship on the Companies model?

Company model:

public function sections()
{
    return $this->hasMany('App\Section');
}

User model:

public function sections()
{
    return $this->belongsToMany('App\Section','section_user');
}

I am assuming it should be hasOneThrough but I am unable to make it work

Activity icon

Started a new Conversation Laravel Relationships

Hello, I have a database

table company: id, name

table section: id, name, company_id

table section_user: user_id, section_id

table user: id, name

What should the relationship be to get all users of a specific company?

Aug
10
2 months ago
Activity icon

Started a new Conversation Overriding Methods Of Laravel

Hello, i am attempting to change a function in a laravel file.

The function I am attempting to override can be found in: Illuminate\Foundation\Auth trait AuthenticatesUsers public function showLoginForm();

Since its a vendor file I am unable to save my edits, thus I want to bring the function into my controller.

My login controller:

use Illuminate\Foundation\Auth\AuthenticatesUsers;

class FControllerLogin extends Controller
{

    use AuthenticatesUsers;
    public function showLoginForm()
    {
        return redirect('admin/login');
    }

But my application is still using the old method found at Illuminate\Foundation\Auth\AuthenticatesUsers. How do I force override it?

Jul
28
2 months ago
Activity icon

Started a new Conversation Working Around 2 Forms With Dropzonejs

Hello guys,

i am attempting to use the dropzonejs library to make multiple file drop with preview quickly.

But I ran into a problem that I'm not sure how to workaround. I end up creating 2 forms and that of course cant happen. The main blade:

<form method="post" action="{{ ($action) }}" enctype="multipart/form-data">
                <input name="_token" type="hidden" value="{{ csrf_token() }}"/>
                @foreach($fullList as $list)
                    @php $data = $list->toArray(); @endphp
                    @foreach($data as $key => $value)
                            @if($key == 'logo')
                                <div class="col-sm-9">
                                    @include('uploadFile')
									</form>

And then I have the dropzonejs on the blade uploadFile:

<div class="container-fluid">
    <div class="panel-body">
        <form id="dropzoneForm" class="dropzone" action="{{ route('dropzone.upload') }}">
            @csrf
        </form>
        <div align="center">
            <button type="button" class="btn btn-info" id="submit-all">Upload</button>
        </div>
    </div>
</div>

This makes 2 forms and cant work, but also I am unable to make the dropzoneForm without making it a form, how can it be done?

Jun
22
4 months ago
Activity icon

Started a new Conversation Laravel Posting Data Via Ajax

I am attempting to call my controller that would update my product:

public function update(Request $request, $product_id)
{
    $product = Product::find($product_id);
    $product->name = $request->name;
    $product->test = $request->session()->get('test');;
    $product->save();
    return response()->json($product);
}

I would like to trigger the event with ajax, a button is clicked and my controller is called with the data that then inserts it into database.

I tried to do:

$.ajax({
            type: POST,
            url: my_url,
            data: formData,
            dataType: 'json',
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log('Error:', data);
            }

But that already posts before calling my controller, how can i just throw all data to controller instead of posting it?