me10071990

me10071990

Software Engineer at Learner

Member Since 1 Year Ago

Budapest Hungary

Experience Points
5,140
Total
Experience

4,860 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
4
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 2
5,140 XP
Aug
28
1 month ago
Activity icon

Replied to How To Update Package Using Putty?

yes i checked the code also and changed the condition now it's working, thank you, way was like copy vedor file local to server and also composer.json too. :)

Activity icon

Replied to How To Update Package Using Putty?

@jlrdw yes you are right, however i just update locally and copy updated vendor file and past in server but when running api file then getting error is 505 server error

Activity icon

Started a new Conversation How To Update Package Using Putty?

Is it possible to update the package or install new package on live server like I want to update from 6.0 to 7.0 laravel by using ssh or putty?

Aug
20
2 months ago
Activity icon

Replied to Trying To Set The Condition As Per Data Value By Using Java Script, Getting None

@automica, thank you for response, i have updated the code already and here is my blade file, thank you.

   		<div class="">
                        <p><font size="3" color="#FFFFFF">API :@foreach($data as $ApiData)
                            <font size="6" color="#00FF00">{{$ApiData}}</font></p>
                 @endforeach
                    </div>
Aug
18
2 months ago
Activity icon

Started a new Conversation Trying To Set The Condition As Per Data Value By Using Java Script, Getting None

I am trying to forecast the data and it is getting the same value repeatedly and nothing has been change, can do with another way?

here is code

	<script type="text/javascript">
           $( document ).ready(function() {
           if ($('.ApiData').html() <= 50) {
	
 	<h1>raining></h1>
       
           }

          if ($('.ApiData ').html() > 50 && $('.ApiData').html() <= 100) {
	
		<h1>hotty</h1>
       
    		}

    	    if ($('.ApiData').html() > 100 && $('.ApiData').html() <= 200) {
	
		<h1>sunny></h1>
       
    		}

 		   if ($('.ApiData').html() > 200 && $('.ApiData').html() <= 300) {
	
		<h1>darking sky></h1>
       
    		}

   		 if ($('.ApiData').html() > 300 && $('.ApiData').html() <= 400) {
	
		<h1>clowdy></h1>
        
    		}

   
	    });
	</script>

and here is my controller

		$client = new Client();
    		$response = $client->request
    		('GET', 'http://apie.com/Repository/eliv/i/latest/latest.csv');
    		$statusCode = $response->getStatusCode();
    		$body = $response->getBody()->getContents();
    		$csv=explode(",",$body);

      		$ApiData=$csv[1];


   			  foreach ($csv as $row)
  			 {
       		$ApiData=str_getcsv($row);
   			}
Aug
13
2 months ago
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

Thank you @sinnbeck , set that code and working fine.

Aug
12
2 months ago
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

Yes, but why could not set the image or text with condition in controller, if i need 500 error for a small place then it should be used in there only, can change abort(500, 'Bad response'); to like text or image without redirect or return review?

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

and it's aborting the whole website with 500 Server Error when using condition

	if (strpos($body, '<html>') === 0) 
        {
            
                            
            abort(500, 'Bad response');
         }

something strange with code

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

why its showing error with my string if it was working fine , i don't know why this happing with my code

		syntax error, unexpected 'connected' (T_STRING)
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@sinnbeck , I tried with this logic but still has the same

		 $csv=explode(",",$body);
        //$csv = array_map('str_getcsv', explode("\n", $body));
        //dd($csv);
        

            if (strpos($body, '<html>') === 0) 
            {
                 Stay connected...
                                
                abort(500, 'Bad response');
             }

            endif

            if(strpos($body, '<html>') >= 0)

                    {
                        $ApiData=$csv[1];

                    }

           foreach ($csv as $row)
       {
           $ApiData=str_getcsv($row);
       }

still has the same condition, any specific reason to this?

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

yes, but now how can i hide this error for temporary? can i do some condition if it is not working currently when it work fine then auto correct?

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

Yes it is same in dump

array:10 [▼
0 => array:1 [▼
	0 => "<html>"
]
1 => array:1 [▼
	0 => "<head>"
]
2 => array:1 [▼
	0 => "<meta http-equiv="Refresh" content="1; 			 
    URL=http://172.30.185.25:8090/ssssportal/dailyFupPlanRedirection.do">"
]
3 => array:1 [▼
	0 => "<meta http-equiv="pragma" content="no-cache">"
 ]
4 => array:1 [▼
	0 => "</head>"
]
5 => array:1 [▼
	0 => "<body>"
]
6 => array:1 [▼
	0 => "Please wait while you are redirected ..."
]
7 => array:1 [▼
	0 => "</body>"
]
8 => array:1 [▼
   0 => "</html>"
]
9 => array:1 [▼
	0 => null
]
]
				

and without dump, when using this

	            $csv = array_map('str_getcsv', explode("\n", $body));
 	            //dd($csv);
        		   // $ApiData=$csv[1];

            	  if(count($csv) >= 2)
                      {
                      $ApiData=$csv[1];
                     }

error is str_getcsv() expects parameter 1 to be string, array given

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

yes, you are right , i have two column in my real file of csv, and in the link that i updated here it has only onecolumn, so where i do modify

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

it's error like

array_map(): Expected parameter 2 to be an array, string given

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@snapey , i did and still it's same message, i have update the dull code even

and the message

	<html> <head> <meta http-equiv="Refresh" content="1; 			 
           URL=http://172.30.185.25:8090/ssssportal/dailyFupPlanRedirection.do"> <meta http-equiv="pragma" 
           content="no-cache"> </head> <body> Please wait while you are redirected ... </body> </html>
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

yes that is correct but inside company can access and now i have another link that have only one row

'https://cdn.wsform.com/wp-content/uploads/2020/06/industry.csv'

Aug
11
2 months ago
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

i followed this

$response = $client->request
    ('GET', 'http://apie.com/Repository/eliv/i/latest/latest.csv', ['allow_redirects' => true]);

however still have same message on page as error it has not been clear.

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

it could be @sinnbeck , however i am trying to set if data is not available then it should be clear weather message and when >50 then raining message , now it's getting message like

<html> <head> <meta http-equiv="Refresh" content="1; 				 
     URL=http://172.30.185.25:8090/ssssportal/dailyFupPlanRedirection.do"> <meta http-equiv="pragma" 					 
        content="no-cache"> </head> <body> Please wait while you are redirected ... </body> </html>

on all design and it's making website bad, how can show another message if value is not there as i tried then getting error.

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@sinnbeck, so what do i do next, let me show all code , now my value was 12.11 and also trying to set if condition if value >50 then show raining, but it's not working all, thank you

here is controller

    $client = new Client();
        $response = $client->request
        ('GET', 'http://apie.com/Repository/eliv/i/latest/latest.csv');
        $statusCode = $response->getStatusCode();
        $body = $response->getBody()->getContents();
        $csv=explode(",",$body);

          $ApiData=$csv[1];


       foreach ($csv as $row)
       {
           $ApiData=str_getcsv($row);
       }

here is blade

	@foreach($data as $datas)

	   API : {{$datas}}

	@endforeach
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@abrahamghaemi , it is existing and just it's getting error, thank you.

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@bobbybouwmann thank you, i have 2 value and from this displaying one value and also trying to multiple condition so getting error.

Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@sinnbeck thank you, i have csv file in which getting value and on blade was showing only one, before it was working fine now after dd

	array:1 [▼

0 => """ Please wait while you are redirected ... """ ] """

Please wait while you are redirected ...
Activity icon

Replied to ErrorException (E_NOTICE) Undefined Offset: 1

@tisuchi thanks the error is not occuring , however in blade my value was showing before now it's showing

	API: <html>

here is blade code

          @foreach($data as $datas)

 API : {{$datas}}

@endforeach

Activity icon

Started a new Conversation ErrorException (E_NOTICE) Undefined Offset: 1

The code was working fine for API display before and today it's not working .

   $csv=explode(",",$body);

        $ApiData=$csv[1];

       foreach ($csv as $row)
       {
           $ApiData=str_getcsv($row);
       }
Aug
05
2 months ago
Activity icon

Replied to Read Data From LDAP Server In Laravel

it has been long and able to read data, thank you

Activity icon

Replied to Error Call To Undefined Function App\Http\Controllers\

i am followed in starting but nothing has changed

Activity icon

Replied to Error Call To Undefined Function App\Http\Controllers\

Yes xampp is working but still has same issue, shall i run below command in laravel

php artisan vendor:publish --provider="Adldap\Laravel\AdldapServiceProvider" php artisan vendor:publish --provider="Adldap\Laravel\AdldapAuthServiceProvider"

Activity icon

Replied to Error Call To Undefined Function App\Http\Controllers\

Yes, i did it i found the same solution and applied already but nothing happens.

Activity icon

Replied to Error Call To Undefined Function App\Http\Controllers\

I am running laravel by using xampp, so which type of ldap module shall i use in case of openladp server?

Aug
04
2 months ago
Activity icon

Replied to Error Call To Undefined Function App\Http\Controllers\

@sinnbeck , i am trying to use openldap with window and here is version:

"license": "MIT", "require": { "php": "^7.2.5", "fideloper/proxy": "^4.2", "fruitcake/laravel-cors": "^1.0", "guzzlehttp/guzzle": "^6.3", "laravel/framework": "^7.0", "laravel/tinker": "^2.0", "laravelcollective/html": "^6.1", "ext-ldap": "*"

what should i do next , help please thank you.

Activity icon

Started a new Conversation Error Call To Undefined Function App\Http\Controllers\

i m trying to read set the connection and getting error in controller.

Please help, thank you.

Jul
26
2 months ago
Activity icon

Replied to ErrorException Ldap_search(): Partial Search Results Returned: Sizelimit Exceeded

@bobbybouwmann thank you for support, however i gone through it and now still the same issue, I am just routing to http://127.0.0.1:8000/home page without login and for import i used command but why getting this issue still looking for solution.

Activity icon

Started a new Conversation ErrorException Ldap_search(): Partial Search Results Returned: Sizelimit Exceeded

Good morning all,

    php  :7.2.5
    adldap2/adldap2-laravel  :6.1
    laravel/framework :7.0,

I am trying to synchronized more than 1000 users data from OpenLDAP server, how to fix this error

    ErrorException  ldap_search(): Partial search results returned: Sizelimit exceeded

   at C:\xampp\htdocs\adminless\vendor\adldap2\adldap2\src\Connections\Ldap.php:286
   * {@inheritdoc}
   */
   public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0)
   {
     return ldap_search($this->connection, $dn, $filter, $fields, $onlyAttributes, $size, $time);
   }

 
   C:\xampp\htdocs\adminless\vendor\adldap2\adldap2\src\Connections\Ldap.php:286
   ldap_search("dc=example,dc=xxx,dc=in", "(&(objectclass=effe) 
  (objectclass=
  fe)(uid=*))")

   C:\xampp\htdocs\adminless\vendor\adldap2\adldap2\src\Query\Builder.php:474
   Adldap\Connections\Ldap::search("dc=example,dc=xxx,dc=in", "(& 
   (objectclass=effe)(object
  class=fe)(uid=*))")

Thank you all.

Jul
15
3 months ago
Activity icon

Started a new Conversation Getting Error Adldap\Auth\BindException : Can't Contact LDAP Server

Hi all, I am reposting the issue again as in previous, i didn't get any response. I completed with code and trying to run the php artisan adldap:import, when running this code then getting error :

Adldap\Auth\BindException : Can't contact LDAP server at

C:\xampp\htdocs\Internal_Search_Ldap\vendor\adldap2\adldap2\src\Auth\Guard.php:107

Exception trace:

1 Exception::("Can't contact LDAP server") C:\xampp\htdocs\Internal_Search_Ldap\vendor\adldap2\adldap2\src\Auth\Guard.php:102

2 Adldap\Auth\Guard::bind("username", "secret") C:\xampp\htdocs\Internal_Search_Ldap\vendor\adldap2\adldap2\src\Auth\Guard.php:119

In login Controller

class LoginController extends Controller { use AuthenticatesUsers;

protected $redirectTo = RouteServiceProvider::HOME;

public function __construct()
{
    $this->middleware('guest')->except('logout');
}

public function showLoginForm()
{
    return view('auth/login');
}

protected function login(Request $request)
{
    $username = $request->email;
    $password = $request->password;



    $server = '52.87.186.93'; 
    $domain = 'ldap.forumsys.com';
    $port = 389;
    $port_ssl = 686;

    echo $username.$domain ;
    echo "</br>" ;
    $connection = ldap_connect($server, $port);
    if (!$connection) {
        exit('Connection failed');
    }

    // Help talking to AD
    ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
    ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);

    ldap_set_option($connection, LDAP_OPT_NETWORK_TIMEOUT, 10);
    ldap_set_option($connection, LDAP_OPT_TIMELIMIT, 10);
    ldap_set_option($connection, LDAP_OPT_TIMEOUT, 10);

    $bind = @ldap_bind($connection, $username.$domain, $password);
    if (!$bind) {
        exit('Binding Failed');
    }

    $results = ldap_search($connection, '// dc compont', "(cn=*)");

    $entries = ldap_get_entries($connection, $results);

    if($entries){
        echo $entries["count"]." entries returned\n";

    }

    $credentials = $request->only('email', 'password');
    if (Auth::attempt($credentials)) {
        echo Auth::id() ;
        // return redirect('/home');

        for ($i=0; $i<$entries["count"]; $i++) {

            print_r ($entries[$i]["cn"][0]) ;
            echo "</br>";
        }

    }else{
        echo "failed" ;
    }

    ldap_close($connection);

}

}

and my ldap.php

Jul
14
3 months ago
Activity icon

Replied to Read Data From LDAP Server In Laravel

Thank you @bugsysha , i done with some code in controller however nothing is showing .

class LoginController extends Controller { use AuthenticatesUsers;

protected $redirectTo = RouteServiceProvider::HOME;

public function __construct()
{
    $this->middleware('guest')->except('logout');
}

public function showLoginForm()
{
    return view('auth/login');
}

protected function login(Request $request)
{
    $username = $request->email;
    $password = $request->password;



    $server = '23.20.46.132  '; //ip like ldap://192.168.1.1
    $domain = 'ldap.forumsys.com  '; //domain name on ldap
    $port = 389;
    $port_ssl = 686;

    echo $username.$domain ;
    echo "</br>" ;

    $connection = ldap_connect($server, $port);
    if (!$connection) {
        exit('Connection failed');
    }

    // Help talking to AD
    ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
    ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);

    ldap_set_option($connection, LDAP_OPT_NETWORK_TIMEOUT, 10);
    ldap_set_option($connection, LDAP_OPT_TIMELIMIT, 10);
    ldap_set_option($connection, LDAP_OPT_TIMEOUT, 10);

    $bind = @ldap_bind($connection, $username.$domain, $password);
    if (!$bind) {
        exit('Binding Failed');
    }

    $results = ldap_search($connection, '// dc compont', "(cn=*)");

    $entries = ldap_get_entries($connection, $results);

    if($entries){
        echo $entries["count"]." entries returned\n";

    }

    $credentials = $request->only('email', 'password');
    if (Auth::attempt($credentials)) {
        echo Auth::id() ;
        // return redirect('/home');

        for ($i=0; $i<$entries["count"]; $i++) {

            print_r ($entries[$i]["cn"][0]) ;
            echo "</br>";
        }


    }else{
        echo "failed" ;
    }


    ldap_close($connection);

}

}

Thank you..

Jul
12
3 months ago
Activity icon

Replied to Where To Variable And Hostname If I Want To Use LDAP Active Directory In Laravel.

@bobbybouwmann thank you so much for that documentation link, my code running . however i am not sure is data getting from LDAP server or not. Because on http://127.0.0.1:8000/ only blank. How can sure by login controller as i code in it for response.

thank you.

Activity icon

Replied to Where To Variable And Hostname If I Want To Use LDAP Active Directory In Laravel.

Yes @bobbybouwmann , i am on installation then configuration. However, I read the documentation and somewhere it has been mentioned that we can do configuration in .env file and somewhere mentioned in config file. So here i am confused. so please help in that. what should I followed.?

here is link https://ldaprecord.com/docs/configuration/ in configure it has not defined where we have to do this like in .env or somewhere else.

Thank you.

Activity icon

Started a new Conversation Where To Variable And Hostname If I Want To Use LDAP Active Directory In Laravel.

Hello everyone,

The previous problem has been solved and no I want to how to do next process after

composer require directorytree/ldaprecord in laravel.

What next step for read data only from LDAP active directory

Thank you,

Jul
08
3 months ago
Activity icon

Replied to Read Data From LDAP Server In Laravel

Yes, I just did with simple authentication in php to how it works and I want to use another LDAP sever, but don't have any idea , how to do in laravel without authorisation, just want fetch data and read and apply own search condition on blade page. So I asking the same.

Activity icon

Replied to Read Data From LDAP Server In Laravel

thank you @bugsysha , I have visited with php LDAP and even did this by followed the same, however I want to do through Laravel. is it not possible to read data and apply search conditon.

Activity icon

Started a new Conversation Read Data From LDAP Server In Laravel

Hello Everyone,

Is it possible to read data from LDAP server and apply own search condition in laravel?

Thank you,

Jun
29
3 months ago
Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

@m7vm7v @snapey @jlrdw, thank you all, it works , the security check has been updated, so from outside I was not able to upload. Now working.

Thank you so much all.

Jun
27
3 months ago
Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

@snapey , I changed the code and still has same error.

here is link of config/filesystems.php

https://imgur.com/a/Tg5qCgp

Thank you

Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

No if I am editing the text then there are no error and sorry , my means file are not moving means , not saving on data base.

Thanks @snapey

Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

Yes @snapey , thank you.

In .env file is not available to download.

Yes file are not moving.

so where I have to make changes in controler?

Jun
26
3 months ago
Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

@jlrdw here is link of image

or

https://imgur.com/a/YTwGqgq

I tried to change the path , it was outside of App_files then I make inside App_files.

Activity icon

Replied to Unable To Create A Temporary File In Unknown On Line 0

I will ask to server manager to send the screenshot of server file images so it will help me more. And I will update here.

Thank you @jlrdw