Lola

Lola

Member Since 1 Year Ago

Experience Points 880
Experience Level 1

4,120 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 1
Lessons
Completed
Best Reply Awards 0
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.

19 Apr
11 months ago

Lola left a reply on Laravel - Save Form Data

About passing with javascript effect good idea, but then validation part will be changed, smth. with ajax that why I'mnot sure for using it...

16 Apr
11 months ago

Lola left a reply on Laravel Datatable Sort For Data From Ajax Call

it's my test ajax

$('#users-table').DataTable({
            processing: true,
            serverSide: true,
            ajax: '{{ route('orderdata')}}',
            columns: [
                { data: 'name', name: 'name' },
                { data: 'price', name: 'price' },
                { data: 'currency', name: 'currency' },
                { data: 'description', name: 'description' }
            ]
        });

And i have smth like this

$(".loadMoreTools").on("click",function () {
            $.ajax({
                url : '{{ route("tooldata") }}',
                method : "POST",
                data : {count:count, _token:"{{csrf_token()}}"},
                dataType : "json",
                success : function (data)
                {
                   
                        $('#load-data').append(data['data']);
                     
                }
            });
        })

Then when I try to order I lost my loaded data.

what I do wrong? I read the doc , but I'm not sure.... what is my bug..

I try to write smth liek this

$(".loadMoreTools").on("click",function () { $('#load-table').DataTable({ processing: true, serverSide: true, ajax: '{{ route('tooldata')}}', columns: [ { data: 'name', name: 'name' }, { data: 'price', name: 'price' }, { data: 'currency', name: 'currency' }, { data: 'description', name: 'description' } ] });

}

but it's not right...

Lola started a new conversation Laravel Datatable Sort For Data From Ajax Call

Hello, I need a help, some advice to orientated

I have some data on my page, the best way (oriented on design) is using a table structure

 smth like this

    <table>
        <thead>
            <th><td>.Name</td></th>
            <th><td>...</td></th>
            <th><td>...</td></th>
        </thead>
        <tbody>
                <tr><td>...</td></tr>
            <tr><td>...</td></tr>
            <tr><td>...</td></tr>
        </tbody>
    </table>

Also, I have some load button

    <div> Load More </div>

When I click on it I get the next data's that I need to show from my table

I implement datatables, but when I click on datatbles sort after clicking "Load More" button , I loose data that I get from my ajax call.

What I can do? At this moment, I have only one idea, to write some custom order...

but the perfect way I think is datatable using... So I need to find the best way to solve this problem... Please help me to find some good decision.

Lola started a new conversation Laravel DataTable

Hello , I need some advice ... I need to order some data in my table, so I think that better way is using datatables. I just integrate it in site. Or exist some plugin? I test yajra/laravel-datatables-oracle , but I'm not sure which one is more better for use.

13 Apr
11 months ago

Lola started a new conversation Laravel - Save Form Data

I have some page wich datas I need to save in case if I save data the second page. I mean I fill the form, validate it, and click nect button, and go to second page, where I fill the second part of information.

Also I have question about form url , it need to be the same name for that pages?

What's the better way?Using sessions?

12 Apr
11 months ago

Lola left a reply on Laravel . Frontend Framework Needed Or No?

Hm , but in case if in future I will need some api for mobile? Is it good idea?

Lola left a reply on Laravel . Frontend Framework Needed Or No?

Its an medical site, where I have two types of users, doctors & and secretaries. they can add pacients, and some details about them, also do some research, add some events, and get some info about medications&tools

Lola started a new conversation Laravel . Frontend Framework Needed Or No?

Hi , I'm starting new project, and I'm not sure that I need any frontend framework ( angular, react, vue)

How I can be sure that using some frontend framework is good idea ?

can anyone give me some advice? I read some articles, but there are not helpfull.

09 Apr
11 months ago

Lola left a reply on Laravel Api & Angular5

here's my angular server file

import { Injectable } from '@angular/core'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/observable/throw';

import { Observable } from 'rxjs/Observable'; import { environment } from '../../environments/environment'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Router } from '@angular/router';

@Injectable() export class ServerService { api_url: any = environment.api_url;

constructor(private http: HttpClient,
            private router: Router) {
}

private setHeaders(): HttpHeaders {



    const headersConfig = {
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    };

    return new HttpHeaders(headersConfig);
}

private formatErrors(resp: any) {
    return Observable.throw((undefined !== resp.error) ? resp.error : 'Error 500!');
}

/**
 * Use GET method globally
 * @param {string} path
 * @param {URLSearchParams} params
 * @returns {Observable<any>}
 */
get(path: string, params: HttpParams = new HttpParams()): Observable<any> {
    return this.http.get(`${this.api_url}${path}`, {headers: this.setHeaders(), params: params})
        .catch(this.formatErrors);
}

/**
 * Use PUT method globally
 * @param {string} path
 * @param {Object} body
 * @returns {Observable<any>}
 */
put(path: string, body: Object = {}): Observable<any> {
    return this.http.put(
        `${this.api_url}${path}`,
        JSON.stringify(body),
        {headers: this.setHeaders()}
    )
        .catch(this.formatErrors);
}

/**
 * Use POST method globally
 * @param {string} path
 * @param {Object} body
 * @returns {Observable<any>}
 */
post(path: string, body: Object = {}): Observable<any> {
    return this.http.post(
        `${this.api_url}${path}`,
        JSON.stringify(body),
        {headers: this.setHeaders()}
    )
        .catch(this.formatErrors);
}

/**
 * Use DELETE method globally
 * @param path
 * @returns {Observable<any>}
 */
delete(path): Observable<any> {
    return this.http.delete(
        `${this.api_url}${path}`,
        {headers: this.setHeaders()}
    )
        .catch(this.formatErrors);
}

}

api I create something like this

https://www.toptal.com/laravel/restful-laravel-api-tutorial

and laravel passport from oficial site. but when I try to get my links (postman ) smth, I will get some error :(... just don't know where is my bug...

Lola left a reply on Laravel Api & Angular5

No, with gettting and sending I don't have any problem. I have Cors. My problem is in authentication, when I try to give permissions only for my authenticate client to or get some data.

08 Apr
11 months ago

Lola started a new conversation Laravel Api & Angular5

I have write some laravel api with using passport and

trying to connect from angular app... but have problem with headers.

Please give me some advice , link to solve this problem.

05 Apr
11 months ago

Lola started a new conversation Laravel & Angular5

After "ng build" in my angular app (its located in resources/assets/src/my-angular-app/ ), when I open my laravel project I see the pages, and all works, but when I reload the page, it's say "Sorry, the page you are looking for could not be found." I know why it say :) but I don't know what i can do to fix that.

can you help me? any advice or some link? thnks :)

03 Apr
11 months ago

Lola left a reply on Csrf Token

in angular JS yes it works, but with angular not...

Lola started a new conversation Csrf Token

I have successfully implemented angular to my laravel 5.5 framework , and I successfully work with get requests

But in post case, I have problem with csrf token .

what is the better way to implement token in angular componen.html file?

29 Mar
11 months ago

Lola started a new conversation Laravel & Angular

I need some advice , It's my first project with laravel & angular4 , so i'mnot sure that i'm right I create laravel5.5 app with angular4 and I use this https://appdividend.com/2017/09/22/laravel-5-5-angular-4-tutorial-example-scratch/ tutorial then I find this https://github.com/ilirhushi/laravel5.5-angular5

So I need two advices :) please help me

For first I need to know is this a best/right way?

For project running I need to run php artisan serve(localhost:8000) & ng serve(localhost:4200) . Can I do something to run them on one server? for example test.dev, the angular -> use test.dev/api , the laravel admin will be available on -> test.dev/admin link...

16 Mar
1 year ago

Lola left a reply on Multi Auth

https://www.youtube.com/watch?v=iKRLrJXNN4M

this guard help me to solve guards problem

Lola left a reply on Validation

what about using the same request for different controllers? for example if I have 3 controllers that have same validation rules is it good for code to use for all of them the Same REQUEST??

14 Mar
1 year ago

Lola started a new conversation Validation

what is the best way for validation ?

in controller if rules are simple and in Requests(php artisan make:request .......) if I have some custom rules?

Or can I use the same Requests for several models?

12 Mar
1 year ago

Lola started a new conversation Laravel 5.5 Linux 3.10.0 Server

I add project to server and create in public_html folder .htaccess

RewriteEngine On RewriteRule ^(.*)/$ public/$1 [L]

And I get this error

Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

from putty I cann't use sudo command ,

so I just run chmod -R 777 ... But I still have this ...

may be the problem is in htaccess?

07 Mar
1 year ago

Lola left a reply on Laravel Roles

yeh I have something like that, just in dataSecretary (secretary_profiles) I have role_id, and i have roles table and role_permission table, I use gates

if (! Gate::allows('event_create')) { return abort(401); }

@can('event_create')

/** some view ***/

@endcan

members can see all pages, but secretaries just a part. I don't know all details, but for example for him will be visible only some part of page... so if I will use MiddleWare can I have access only some part of page?

p.s. I use MiddleWares for admin panel access... (guards:admin, api)

06 Mar
1 year ago

Lola started a new conversation Laravel Roles

I need some advice I have two types of users, members and their secretaries (all columns are different except email, password fields) , also secreteraies don't access some pages...

The login form is the same , so I add some table (users) with types => member, secretary , for each type I have some profile table , also for secretaries table I have some role_id for choosing permissions .

Is it good idea or no?

May be I need to have two different tables? members & secretaries? (the same form little confusing)

03 Mar
1 year ago

Lola left a reply on Multi Auth

hm, but if I use different models? and for site_address/admin link I need some separate view and for site/ some other?

And for each site part I use angular 4? I now about roles , but I used them for users part.... Its bad way? I need to use it for admin too?

02 Mar
1 year ago

Lola left a reply on Multi Auth

it's my RedirectIfAuthenticated.php

    if ($guard ==  'admin' ) {
            if (Auth::guard($guard)->check()) {
                return redirect()->route('admin.login');
            }
       else {
    if (Auth::guard($guard)->check()) {
                return redirect()->route('user.dashboard');
            }
    }
    return $next($request);

handler.php

protected function unauthenticated($request, AuthenticationException $exception) { if ($request->expectsJson()) { return response()->json(['error' => 'Unauthenticated.'], 401); }

    $guard = array_get($exception->guards(), 0);

    if($guard == 'admin'){
            $login = 'auth.login';
}
else {            
    $login = 'user_auth.login';
      
    }
    return redirect()->guest(route($login));
   
}

and in Config/auth.php=>

'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ],

    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Models\Admin::class,
    ],

I generated Auth by => php artisan make:Auth (copy it for admin => separate folders for each other - Auth for Users and Admin/Auth for Admin )

and in loginController I add showLoginForm , Login functions (to send separate views in resources/views)

but when I logged in i have some bugs...also I'm not sure that it's right way...

Lola left a reply on Multi Auth

yeh I use different Auth systems, for Admin -> Http/Controllers/Admin/Auth and for users -> just an Http/Controllers/Auth

I use guards, for each user I want to choose it guard... Also I rewrite main Auth controllers (login ...reset...) functions, but it not works correct

Lola started a new conversation Multi Auth

Laravel 5.4/5.5

I have two/three kinds of users

1.for Admin panel => site_name/admin 2.for users and some sedcretars site/

I have added in config/auth.php guards , also separate views, routes, controllers but i still have problem, with Auth ... everytime I go to same page...

could anyone give some advice what kind of mistake I have?

27 Feb
1 year ago

Lola started a new conversation Laravel & AngularJs VS Laravel &Angular

Hello, I successfully integrated Angular4 to my laravel project, also do same for angular js to ... And I am not sure which is the best?

Also at this moment what is the most stable version of laravel ?