How to get base_url() while running via CLI Codeigniter - codeigniter-2

I am trying to send email using crontab, In the email body there are some images that need to give base_url, Currently we are setting base_url dynamically.

Related

Laravel Nova: The login form is in HTTP instead of HTTPS

Context
I've installed Laravel Nova, executed the migrations and created the Nova user by following the docs https://nova.laravel.com/docs/3.0/installation.html#installing-nova . Now I'm trying to login.
Expected behavior
When I send the login form, I'm redirected to the backoffice panel.
Actual behavior
When I send the login form, I'm redirected to a Chrome page "This page is not secured, are you sure you want to send your form data?" (approximately the English translation of the French displayed error :D ).
Clues
The login form is shown at this URL: "https://.../nova/login".
The login form, however, contains this action: "http://.../nova/login" - NB: so it's not HTTPS, but HTTP.
Question
Where could I set a Laravel and/or Nova config option to tell Nova to use https instead of http in the action of the login form Nova shows?
Since Nova doesn't seem to use any environment/configuration option to be able to choose the good HTTP/HTTPS protocol, I've directly written the following, in app/Providers/AppServiceProvider (NB: I don't really know the drawbacks of this solution so I don't recommend you to do it, even if in my case it worked well to fix this bug):
public function boot()
{
\URL::forceScheme('https');
}

how to send custom html verification email?

I want to replace the default verification email of Laravel 5.8 with my own HTML email, so, I tried to search in controllers to see where it is getting generated so I can replace but I could not find it.
My question exactly is: how can I replace the default verification email in Laravel 5.8? and how to access the same parameters that are in the default emai? for example the token and the username.
You can override email templates. You need to run this first:
php artisan vendor:publish --tag=laravel-mail
Now in your resources/views/vendor/mail, you can customize the the email templates or create your own HTML templates there. The standard method is to customize or extend the default email templates come with Laravel.
But sometimes you may need to use an entirely new email template. In that case, simply place the new email template (inlined-version) in resources/views/vendor/mail directory and use that template using view() method in your mailables.

Mail Embed Image timing out laravel 5.8

Using laravel 5.8 . Have the below img tag in the mail blade template . logo image exists in the directory. Laravel code times out when it encounters the below statement. Logo seems to be not appearing in the email if i have the url directly in the image tag.
Is there any time out settings i need to do in laravel 5.8 for the embed to work? When i test the below in my local system it works. Integrated with aws ses.
embed(url('/assets/img/logo/logo-2.png')) }}">
Using public_url() function fixed the issue. Also keep logo size minimal for email.

How do I change laravel mail body?

I used laravel default Auth to learn laravel by using php artisan make:auth. Where I also used default mailing of laravel.
I want to know about mailing process. I able to send password reset mail. But I want to change this default mail format. Where I can change this or how?
You can modify your laravel mail body view from:
vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php
But if you want to change some text information then see below page:
vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php

Get url so can send it in an email

I need to get the url and place it in my code so it can be sent has a link in an email.
SO if i have localhost/interiors/accessories/clocks/mantle-clocks/mantle-clock
I need to get this url so i can place it my controller to send it as an email link.
Use the $_SERVER global. It should contain the information you need, e.g. REQUEST_URI etc
Your problem is pretty simple you can call current_url() helper method of Codeigniter
$url = current_url();
Use this url to send in email. Or if this is not what you want than you will have to manually generate url.
$url = http://localhost/interiors/accessories/clocks/mantle-clocks/mantle-clock';

Resources