Posts

Showing posts with the label Laravel

Custom Email template for Laravel Password Reset

Image
Today I got new task with laravel , since I  have forget passwrod reset scenario. It works but not using the UIs of our theme.Scpecailly mail. However reset pasword section of the follwing helps me . http://miftyisbored.com/a-complete-laravel-5-3-tutorial-for-user-authentication-with-activation-email/ Mailtrap will help you. php artisan vendor:publish --tag=laravel-notifications     // email template php artisan make:notification ResetPassword.          .//edit temaplte parameters chage user class to call notification   public function sendPasswordResetNotification($token)     {         $this->notify(new ResetPassword($token));     } change ResetPassword in notification folder  eg : namespace App\Notifications; use Illuminate\Notifications\Notification; use Illuminate\Notifications\Messages\MailMessage; class PasswordResetNotification extends Notification  {     /**      * The password reset token.      *      * @var strin

Laravel Session Time Out - Trying to get property of non-object Error

Image
I have faced the follwing  error in laravel in user logged pages . Laravel Session Time Out  - Trying to get property of non-object Error The reason for error is session time out of the logged user but it not properly handled in the views . In larvel if the logged in user from auth , can be logged out using same auth middleware. Route::post('controllerName','folderName\fileName@fnNmae')- >middleware('auth'); https://stackoverflow.com/questions/34443632/make-session-expiration-redirect-back-to-login

Laravel using Cookies to Save URL Question Mark Parameter

Image
In Laravel most of the time cookies are set by the response .Further most of the posts does not directly tell how to retire URL Get  parameters. Eg: https://www.blogger.com/? blogID=1441573773987640178 To retrieve the value we can take the value in routes >>web.php Route::get('/', function(){      $term = Input::get(' blogID ');       if(isset($term)){         Cookie::queue(Cookie::make(' blogID ',$term, 60*24*365));       }     return view('home'); }); In here cookies are save using (Cookie::make) . In the next response the cookie value get saved in client browser.               e.g.  $cookie = Cookie :: make ( $name , $value , 60 ); http://laravel-recipes.com/recipes/48/creating-a-new-cookie To retrieve the Cookies value is simple       $request->cookie(' blogID ');

Laravel Customize Auth RegisterController Step By Step

Image
In Laravel Default RegisterController located in Auth/RegisterController can be customized to to meet another requirement. It use the user table of Laravel and not use any e.g. : send the account activation mail with other detail namespace App\Http\Controllers\Auth; use App\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller {     /*     |--------------------------------------------------------------------------     | Register Controller     |--------------------------------------------------------------------------     |     | This controller handles the registration of new users as well as their     | validation and creation. By default this controller uses a trait to     | provide this functionality without requiring any additional code.     |     */     use RegistersUsers;     /**      * Where to redirect users after registr

Comple Guilde on Setup Laravel Bitbucket clone

Image
Guide  https://laravel.com/docs/5.3/installation 1. sudo git clone https://kanchanainterlec@bitbucket.org/interlectivesg/bme_app.git 2. composer install 3.config debug true 4 .create .env mv .env.sample .env 5. php artisan key : generate   6.see error 7. Set permission :chmod -R 777 8.Set the database detail on .env file 9.  php artisan migrate : refresh run the application by moving to public