小编EhS*_*SAn的帖子

在共享主机和 laravel 中创建 Cron 作业

我想使用 Laravel 框架和共享主机每分钟向我的用户发送通知,在我的主机中无法访问 ssh 访问,我对我的英语感到非常抱歉

我的命令

namespace App\Console\Commands;

use App\Classes\NotificationClass;
use Illuminate\Console\Command;

class Checkreserve extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'check:reserve';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'send notification to all user';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     * …
Run Code Online (Sandbox Code Playgroud)

php cron laravel

4
推荐指数
1
解决办法
5996
查看次数

如何将片段中的本地默认值设置为 en

我搜索了无数与此类似的问题,但没有在其中任何一个中找到我的答案。我想将片段中的本地默认设置设置为英语,我使用此代码来和onStart()但 没有工作onAttach()onCreateView()

我的片段代码:

package com.demo.tomcatfire.taskmanagerui;

import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import java.util.Locale;

public class MainFragment2 extends Fragment implements View.OnClickListener {
    private LinearLayout ll_display,ll_add,ll_about,ll_about2,ll_learnig,ll_learnig2;


    @Override
    public void onAttach(Context context) {

        Locale locale = new Locale("en");
        Locale.setDefault(locale);
        Configuration config = new Configuration();
        config.locale = locale;
        context.getResources().updateConfiguration(config,
                context.getResources().getDisplayMetrics());
    }

    @Override
    public void onStart() {

        Locale locale = new Locale("en");
        Locale.setDefault(locale);
        Configuration config = new Configuration();
        config.locale …
Run Code Online (Sandbox Code Playgroud)

android localization fragment

2
推荐指数
1
解决办法
2993
查看次数

标签 统计

android ×1

cron ×1

fragment ×1

laravel ×1

localization ×1

php ×1