小编man*_*oos的帖子

在laravel中返回时重定向到外部URL

我正在尝试使用SMS INDIA HUB API向用户发送一次性密码.为此,我需要重定向到URL格式:

http://cloud.smsindiahub.in/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=919898xxxxxx&sid=SenderId&msg=test%20message&fl=0&gwid=2

如果我们加载此URL,它将返回一些消息.我需要得到那条消息.

我试过这样的

$url = "http://cloud.smsindiahub.in/vendorsms/pushsms.aspx?user=wwww&password=eee&msisdn=9197xxxxx&sid=yyyyy&msg=rrrrr&fl=0&gwid=2";

return Redirect::intended($url);
Run Code Online (Sandbox Code Playgroud)

但它没有指向那个链接.它尝试在localhost中加载该URL.

或者有没有使用SMS INDIA HUB发送短信的插件?

谁能帮忙?

php sms-gateway laravel laravel-4

31
推荐指数
5
解决办法
7万
查看次数

在laravel中如何检查模型的对象是空的?

我使用以下代码使用模型访问我的数据库.

$persons = WysPerson::where('family_id', $id)->get();
Run Code Online (Sandbox Code Playgroud)

$persons通过使用以下代码检查是否为空.

if($persons){
        var_dump($persons);
    }
Run Code Online (Sandbox Code Playgroud)

其实$persons是空的.但我得到的结果var_dump

object(Illuminate\Database\Eloquent\Collection)#417 (1) { ["items":protected]=> array(0) { } }

我怎么检查$persons是空的?有人可以帮忙吗?

php laravel laravel-4 laravel-5

12
推荐指数
1
解决办法
3万
查看次数

如何在Laravel 5.2中将多个参数传递给具有OR条件的中间件

我正在尝试设置访问两个不同用户角色Admin,Normal_User的操作的权限,如下所示.

Route::group(['middleware' => ['role_check:Normal_User','role_check:Admin']], function() {
        Route::get('/user/{user_id}', array('uses' => 'UserController@showUserDashboard', 'as' => 'showUserDashboard'));
    });
Run Code Online (Sandbox Code Playgroud)

Admin或Normal_user可以访问此路由.但在此中间件配置中,用户必须同时是Admin和Normal_User.如何在中间件参数传递中添加OR条件?或者还有其他方法可以给予许可吗?

以下是我的中间件

public function handle($request, Closure $next, $role)
    {
        if ($role != Auth::user()->user_role->role ) {
            if ($request->ajax() || $request->wantsJson()) {
                return response('Unauthorized.', 401);
            } else {
                return response('Unauthorized.', 401);
            }
        }
        return $next($request);
    }
Run Code Online (Sandbox Code Playgroud)

有人可以回复吗?

laravel laravel-5.2

12
推荐指数
3
解决办法
9872
查看次数

如何使用带有错误日志记录的 Electron Wix Creator 解决 msi 包创建中的错误?

我正在尝试从 golang 程序创建一个具有错误日志功能的 msi 包。因此,我将能够检索 golang 应用程序崩溃日志。

以下 Golang 代码保存到main.go,预计会因1\0除法相关错误而崩溃。

package main

import "fmt"

func main() {
    // intentionally cause a divide-by-zero error
    x := 0
    y := 1 / x
    fmt.Println(y)
}

Run Code Online (Sandbox Code Playgroud)

然后我尝试使用以下步骤创建 msi 包:

  • 步骤1:go get github.com/akavel/rsrc
  • 第2步:rsrc -ico .\abc.ico
  • 步骤3:$Env:GOOS="windows"; go build -ldflags "-H windowsgui" -o ABC.exe
  • 步骤4:npm install electron-wix-msi@latest
  • 步骤5:npm install node-gyp@latest --save-dev
  • 第6步:npm install child_process@latest --save-dev
  • 第7步:npm install fs@0.0.1-security --save-dev
  • 第8步:npm i exe-icon-extractor@latest …

go node.js npm electron electron-wix-msi

5
推荐指数
1
解决办法
169
查看次数

如何使用MATLAB在球体内生成随机点

我尝试使用以下命令在center中生成随机点,使用以下命令

no_of_spots = 3000
radius=20
rvals = (2)*rand(no_of_spots,1)-(1);
elevation = asin(rvals);
azimuth = 2*pi*rand(no_of_spots,1);
radii = rand(no_of_spots,1)*radius;
[point_x,point_y,point_z] = sph2cart(azimuth,elevation,radii);
Run Code Online (Sandbox Code Playgroud)

我得到了结果 随机点的球体

从图中可以看出,随机点集中在原点附近,即看起来像高斯分布.我需要在球体内均匀分布的随机点,或者需要将点的浓度从中心移到另一点.我怎么能这样做/任何人都可以帮助/提前谢谢,Manu

random matlab distribution

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

如何计算MATLAB中唯一行的出现次数?

我有一个像下面的矩阵,

A =

     1     2     3
     4     5     6
     7     8     9
    10    11    12
     4     5     6
     7     8     9
     4     5     6
     1     2     3
Run Code Online (Sandbox Code Playgroud)

我可以使用命令A_unique = unique(A,'rows')和结果在此矩阵中提取唯一的行,如下所示

A_unique =

     1     2     3
     4     5     6
     7     8     9
    10    11    12
Run Code Online (Sandbox Code Playgroud)

我需要找到主矩阵中每行存在的次数.A 有些事情如下

A_unique_count =

     2
     3
     2
     1
Run Code Online (Sandbox Code Playgroud)

如何找到唯一行的数量?有人可以帮忙吗?提前致谢

马努

arrays matlab matrix

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

如何解决laravel中的"试图获取非对象属性"错误

以下是我的代码的一部分.但是当我运行该代码时,我收到错误"试图获取非对象的属性".

            $searchdate = Input::get('curdate');
            $teacherid = Auth::user()->id;
            $student = WysStudent::where('studcls',$id)->get();
            $clss = WysClass::where('clsteacher_id',$teacherid)->get();
            $attendence_tbl = WysAttendancename::where('cls_id',$id)->first();
            $wys_attendence_table = $attendence_tbl->attendance_name;
            $attendance = DB::table($wys_attendence_table)->where('adate','=',$searchdate)->get();
            if($attendance && $student){
                foreach ($attendance as $attendance) {
                    foreach ($student as $student) {
                        var_dump($student->id);
                    }
                }                
            }
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

$attendance = DB::table($wys_attendence_table)->where('adate','=',$searchdate)->get();
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-4 laravel-5

0
推荐指数
1
解决办法
1075
查看次数