Posts

codeIgniter_3_1_11/login/forgotpassword

      public function forgotpassword (){         if (! empty ( $_POST ))         {             $email = $this -> input -> post ( 'email' );             $get = $this -> db -> where ( 'email' , $email );             $get = $this -> db -> get ( 'user_accounts' );             if ( $get -> num_rows () > 0 ) {                 $string = '' ;                 $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ;                 $max = strlen ( $characters ) - 1 ;                 for ( $i = 0 ; $i < 8 ; $i ++) {                     $string .= $characters [ mt_rand ( 0 , $max )];...

live serve mate public ni andar se .htaccess

 <IfModule mod_rewrite.c>     <IfModule mod_negotiation.c>        Options -MultiViews     </IfModule>     RewriteEngine On     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule ^(.*)/$ /$1 [L,R=301]     RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]     RewriteCond %{REQUEST_FILENAME} !-d     RewriteCond %{REQUEST_FILENAME} !-f     RewriteRule ^ server.php [L]     RewriteCond %{REQUEST_FILENAME} !-d     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_URI} !^/public/     RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] </IfModule>

laravel public folder ni andar .htaccess file ni andar add krvanu last ma

 <IfModule mod_rewrite.c>   RewriteEngine On   RewriteRule ^(.*)$ public/$1 [L] </IfModule>

laravel php artisan serve remove .htaccess bahar mukvi

  <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d [ OR ] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ ^$ 1 [N] RewriteCond %{REQUEST_URI} (\.\w+$) [NC] RewriteRule ^(.*)$ public /$ 1 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ server.php </IfModule>

image common function in laravel model

   <img src="{!! $getrecord->getImage() !!}" alt="{!! $getrecord->name !!}">      public function getImage() {          if(!empty($this->profile_pic) && file_exists('upload/profile/'.$this->profile_pic)) {             return url('upload/profile/'.$this->profile_pic);          }          else {             return url('upload/profile/iconprofile.png');          }     }          public function getName() {         $name = '';         $name .= ucfirst($this->name);         if(!empty($this->last_name))    ...
 "D:\xampp\htdocs\laravel\nafes\app\Http\Controllers\Auth\AuthController.php"  use App\User; use App\BannedUser; use Auth; use Hash; use Str;       public function login(Request $request){         $credentials = $request->only('username', 'password');         $ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $request->ip());                  if (\Auth::attempt($credentials)) {                      $usr = User::where('username',$request['username'])->first();                      $banned = BannedUser::where('user_ip', $ip)->orWhere('user_id', \Auth::user()->id)->where(function ($query) {  ...