Lola

Experience

880

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 1 Lesson Completed
  • 0 Favorites

19th April, 2018

Lola left a reply on Laravel - Save Form Data • 5 days ago

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...

16th April, 2018

Lola left a reply on Laravel Datatable Sort For Data From Ajax Call • 1 week ago

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 • 1 week ago

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 • 1 week ago

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.

13th April, 2018

Lola started a new conversation Laravel - Save Form Data • 1 week ago

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?

12th April, 2018

Lola left a reply on Laravel . Frontend Framework Needed Or No? • 1 week ago

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? • 1 week ago

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? • 1 week ago

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.

9th April, 2018

Lola left a reply on Laravel Api & Angular5 • 2 weeks ago

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 • 2 weeks ago

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.

8th April, 2018

Lola started a new conversation Laravel Api & Angular5 • 2 weeks ago

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.

5th April, 2018

Lola started a new conversation Laravel & Angular5 • 2 weeks ago

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 :)

3rd April, 2018

Lola left a reply on Csrf Token • 3 weeks ago

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

Lola started a new conversation Csrf Token • 3 weeks ago

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?

29th March, 2018

Lola started a new conversation Laravel & Angular • 3 weeks ago

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...

16th March, 2018

Lola left a reply on Multi Auth • 1 month ago

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

this guard help me to solve guards problem

Lola left a reply on Validation • 1 month ago

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??

14th March, 2018

Lola started a new conversation Validation • 1 month ago

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?

12th March, 2018

Lola started a new conversation Laravel 5.5 Linux 3.10.0 Server • 1 month ago

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?

7th March, 2018

Lola left a reply on Laravel Roles • 1 month ago

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)

6th March, 2018

Lola started a new conversation Laravel Roles • 1 month ago

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)

3rd March, 2018

Lola left a reply on Multi Auth • 1 month ago

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?

2nd March, 2018

Lola left a reply on Multi Auth • 1 month ago

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 • 1 month ago

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 • 1 month ago

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?

27th February, 2018

Lola started a new conversation Laravel & AngularJs VS Laravel &Angular • 1 month ago

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 ?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.