When i click on Reset Password and fill the email and submit it.. then I am getting email for reset but URL is localhost my project is on production server.
In my config\app.php:
'url' => env('DB_HOST'),
and
I also try this : 'url' => env('APP_URL', 'http://yourtradelog.com'),
this is my env. file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=**7
MAIL_USERNAME=apikey
MAIL_PASSWORD=SG.E*****hSbq1IAhFC1tPQg.uFah8Jwtm6GY7lh10wGpA_CPU01ySmAC26HFylz_BFI
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="Your Trade Log"
MAIL_FROM_ADDRESS=****#yourtradelog.com
This is my reset...:
public function toMail($notifiable)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
return (new MailMessage)
->subject(Lang::getFromJson('Reset Password Notification from YourTradeLog.com'))
->line(Lang::getFromJson('You are receiving this email because we received a password reset request for your account.'))
->action(Lang::getFromJson('Reset Password'), url(config('app.url').route('password.reset', $this->token, false)))
->line(Lang::getFromJson('If you did not request a password reset, no further action is required.'));
}
Run the following commands
php artisan clear-compiled
php artisan cache:clear
php artisan route:clear
php artisan view:clear
php artisan config:clear
Also in your .env
set the APP_URL=http://yourtradelog.com
Related
In my Laravel 8 app I created new component with command
php artisan make:component Admin/Auth/loggedUserHasPermissions
and I have error with sending parameter to it from blade file :
Illegal string offset 'name' (View: /mnt/_work_sdb8/wwwroot/lar/AdsBackend8/resources/views/test.blade.php)
On row in resources/views/test.blade.php :
<x-logged-user-has-permissions :logged-user="getLoggedUser()" />
getLoggedUser is funnction in helper file.
and in app/View/Components/Admin/Auth/loggedUserHasPermissions.php
<?php
namespace App\View\Components\Admin\Auth;
use Illuminate\View\Component;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;
class loggedUserHasPermissions extends Component
{
private $loggedUser;
private $hasAdminRole;
public function __construct($loggedUser)
{
$this->loggedUser = $loggedUser;
$this->hasAdminRole = false;
}
public function render()
{
I follow camelCase / kebab-case rules written here https://laravel.com/docs/8.x/blade#passing-data-to-components
running commands
php artisan config:cache
php artisan route:cache
php artisan cache:clear
php artisan view:clear
php artisan clear-compiled
composer dump-autoload
did not help
How it can be fixed?
Thanks!
When I launch command: php artisan route:cache I get message:
Serialization of 'Closure' is not allowed
There is only one closure in routes:
Route::group(['middleware' => ['auth']], function () {
})
I use php 7.1
Move the closure in routes/api.php to controller or comment it
// Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
// });
Then run
php artisan route:clear
php artisan route:cache
Laravel will try to cache routes by serializing to base64 encoded text in bootstrap/cache/routes.php, and closures can't be serialized
This is the function
public function waybills()
{
$user = Auth::user();
if(isset($user)){
$uid = $user->id;
$receives = Receive::where('receiver_code', $uid)->with('clearance')->get();
$archives = Archive::where('receiver_code', $uid)->get();
return view("dashboard.receive.waybills", compact('receives', 'archives'));
}
}
and this is the structure of the directory of files
I tried this following artisan codes
php artisan optimize --force
php artisan config:clear
php artisan route:clear
php artisan view:clear
and the error View [dashboard.receive.waybills] not found. persists
I'm using laravel 5.5. I set my BROADCAST_DRIVER to log but when i access the link to fire the event, nothing happen. The laravel.log file still empty. I already uncomment BroadcastServiceProvider on config/app.php. This is my code
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myDatabase
DB_USERNAME=root
DB_PASSWORD=numberPassword
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
config/app.php
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
app/Events/ReloadTableEvent.php
class ReloadTableEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
protected $coinData;
public function __construct($coinData)
{
$this->coinData = $coinData;
}
public function broadcastWith()
{
return ['coin' => $this->coinData];
}
public function broadcastAs()
{
return 'reload-event';
}
public function broadcastOn()
{
return new Channel('reload-channel');
}
}
app/Http/Controllers/ReloadTableController.php
public function reloadTable()
{
$coin = Coin::take(50)->get();
$event = new ReloadTableEvent($coin);
event($event);
}
I already do this
php artisan config:clear
php artisan cache:clear
php artisan optimize
php artisan clear-compiled
composer update
composer dump-autoload
Still nothing. What should i do?
UPDATE 1
I'm not using listener yet. When i create new project, and set the same option with my current project, it works.
storage/log/laravel.log
[2018-01-08 06:24:02] local.INFO: Broadcasting [reload-event] on channels [reload-channel] with payload:
{
"coin": {
"name": "Test"
},
"socket": null
}
You should listen to the events by php artisan queue:work
here's the code
Route::get('run-cmd', function() {
Artisan::call('make:controller HelloController');
});
and I wonder I'm getting this error...
InvalidArgumentException in Application.php line 549:
Command "make:controller HelloController" is not defined.
Did you mean one of these?
make:migration
make:controller
make:middleware
make:request
make:provider
make:console
make:event
make:model
make:command
what's wrong?
Replace
Artisan::call('make:controller HelloController');
with
Artisan::call('make:controller', [ 'name' => 'HelloController' ]);