lavina

lavina

Member Since 7 Months Ago

Experience Points
1,540
Total
Experience

3,460 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,540 XP
Jul
28
1 week 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
1 month 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?

Apr
20
3 months ago
Activity icon

Started a new Conversation Transfering Files From Vendor

Hello,

i am using: https://github.com/Laravel-Backpack/PermissionManager

but some of the files inside i need to edit, how can i transfer them out of vendor into my project?

Apr
17
3 months ago
Activity icon

Started a new Conversation Overriding Permissionmanager Routes

Hello, i am attempting to use the permission manager from backpack

But currently all my routes are controlled by the files in vendor, even when manually adding one, from route:list i can see:

app\Http\Controllers\Admin\[email protected] admin/user/create

\PermissionManager\app\Http\Controllers\[email protected] admin/user/create

I would like to change the functionality, but i am unable to override the routes.

Since they are in vendor they cannot be saved, how can i move these files over to my project so i can edit them?

Mar
09
5 months ago
Activity icon

Replied to Validating Unity Files

@stereoh the same error: The web gl must be a file of type: application/vnd.unity.

Activity icon

Started a new Conversation Validating Unity Files

Hello,

i am attempting to validate a file upload, the extension that in needs to have is *.unity3d.

I've been attempting multiple ways, and none of them have worked. Do i need to do a custom validation of extension to make it work or?

When i dd the mimetype of my file its: "inode/x-empty"

That, of course, is not enough

None of these work either:

            '' => 'file|required|mimes:application/vnd.unity',
            '' => 'file|required|regex:(unity3d)',
	    '' => 'file|required|mimes:unityweb',
	    '' => 'file|required|mimes:application/octet-stream',

Am i missing something, or do i need to make a seperate manual validation based on extension?

Feb
24
5 months ago
Activity icon

Replied to The Results Of A Failed Request

@sergiu17 Hello, an example: Controller

        public function register(Register $request)
        {
//never reached if validation fails
            dd($request);
    }
Register
    public function rules()
    {
        return [
            'name' => 'required|min:4',
            'email' => 'required|email',
            'password' => 'required|min:8',
            'c_password' => 'required|same:password',
            'is_admin'=>'required',
        ];
    }

If i had done it in a way that i validate in controller like:

        public function register(Register $request)
        {
        $this->validate($request, [
        'name' => 'required|min:4',
            'email' => 'required|email',
            'password' => 'required|min:8',
            'c_password' => 'required|same:password',
            'is_admin'=>'required',
        ]);
if ($this->validate <> true){
Alert::error('Error message')->flash();
}
}

I could just do add an alert, but now, it fails validation, and doesnt reach controller, so i have no idea where to catch the moment, impossible to do it in the request as it only returns requirments, what happens then??

Activity icon

Started a new Conversation The Results Of A Failed Request

Hello,

i am setting up my requests separately from my controller.

When i click a post button all my data is sent over, if it fails, it refreshes page, but i have no idea what the errors were. My controller thus is never reached, i would like to add the problems to an alert and then display them, but i am not sure at what point that can be done, any thoughts?

Feb
21
5 months ago
Activity icon

Started a new Conversation Getting Values From A Blade Form Select

Hello, i am attempting to retireve a selection made on a drop down list. I made the list like this:

    {!! Form::open(['action' => 'Api\[email protected]', 'method' => 'POST', 'enctype' => 'multipart/form-data']) !!}
    <div class="form-group">
        {{Form::label('product', 'Product')}}
        <br>
        {{ Form::select('product', $products) }}
    </div>
    {{Form::submit('Submit', ['class'=>'btn btn-primary', ''])}}
    {!! Form::close() !!}

But when i process it, the request only contains the id of the list itself which is useless for me, how can i get the text of the choice made?

Feb
19
5 months ago
Activity icon

Started a new Conversation Raw Input Into DB

Hello,

I've been attempting to mass insert rows into a table, and update if it already exists. This functionality is not supported by laravel(only for single row inserts as far as i've found), thus i am trying to write a raw insert, but it seems i am using the wrong sql sintax:

DB::insert('INSERT INTO
        products (name, description, created_at, updated_at)
        VALUES
        (\'name\',\'desc\',\'2020-02-19 09:03:45\',\'2020-02-19 09:03:45\'),
    (\'name\',\'desc\',\'2020-02-19 09:03:46\',\'2020-02-19 09:03:46\')
        ON DUPLICATE KEY UPDATE updated_at=\'2020-02-19 09:03:47\';
        ');

And duplicate key seems to only work on primary keys, which i let the table generate, thus each input is unique, how can i specify a different column to check duplicates for?

Feb
14
5 months ago
Activity icon

Replied to Backpack Crud Ordering On A Pivot Table

@mohaj Yes sir, works as expected, thank you very much!

Feb
13
5 months ago
Activity icon

Started a new Conversation Backpack Crud Ordering On A Pivot Table

Hello guys,

i am using backpack and attempting to display a crud admin panel for a pivot table(does not have its own id). But i get the error:

message: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'order clause' (SQL: select * from `section_user` order by 'id` desc limit 10)"

I attempted to add in setup:

$this->crud->orderBy('user_id');

but now its attempting to sort twice:

message: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'order clause' (SQL: select * from `section_user` order by `user_id` asc, `id` desc limit 10)"

How can i override and remove the sort by id?

Feb
12
5 months ago
Activity icon

Replied to Bulk Insert

@divdax "Object of class stdClass could not be converted to string"

Activity icon

Started a new Conversation Bulk Insert

Hello guys, i have a table in my database that contains 3 columns, x/y/z. And i have a json that looks like this:

array:3 [
  0 => array:1 [
    0 => {#649
      +"x": 0.50838017463684
      +"y": 0.47858500480652
      +"z": 0.41899466514587
    }
  ]
  1 => array:1 [
    0 => {#638
      +"x": 0.51666665077209
      +"y": 0.47777771949768
      +"z": 0.49444448947906
    }
  ]
  2 => array:1 [
    0 => {#642
      +"x": 0.0
      +"y": 0.0
      +"z": -2.3841857377249E-9
    }
  ]
]

How can i bulk insert of all them?