草庐IT

laravel-backup

全部标签

php - laravel 中 db 的总和值

我正在尝试将数据库中的值与其他值相加。但它只保留插入值而不是值的总和。有什么想法吗?foreach($isisjkirimsas$key=>$isisjkirim){IsiSJKirim::where('IsiSJKir',$isisjkir[$key])->update(['QSisaKemInsert'=>'QSisaKemInsert'+$qtertanda[$key]]);}^ithinkthisone 最佳答案 需要先获取数据再更新:$data=IsiSJKirim::where('IsiSJKir',$isisjkir[

php - Laravel Query Builder 其间

我构建了一个搜索表单,它将从数据选择器中插入日期的数据库中选择标记。这很好用,但是,当我添加时间时,我得到错误。我重建了一个类似这样的查询:$datefrom=$request->input('datefrom');$dateto=$request->input('dateto');$timefrom=$request->input('timefrom');$timfrom=$timefrom.':00';$timeto=$request->input('timeto');$timto=$timeto.':00';$type=$request->input('type');$maps=

php - 如何在后台休眠 PHP(Laravel 5.2)

我创建了一个artisan命令,我想在调用方法后立即运行它。但是该命令包含一个sleep();命令。我想在后台运行artisan命令,因为该方法需要返回立即响应用户。我的示例代码如下:在路由文件中Route::get('test',function(){Artisan::queue('close:bidding',['applicationId'=>1]);return'calledclose:bidding';});在close:bidding命令中publicfunctionhandle(){$appId=$this->argument('applicationId');//fol

php - Laravel - 临时存储数据

我正在尝试临时存储数据并在其他页面中打印。所选数据仅在我刷新页面之前有效。我该如何解决?谢谢。index.blade.php{!!Form::select('first_name',$firstNames)!!}GoDashboardController.phppublicfunctiongetIndex(Request$request){$this->data['online_users']=\DB::table('tb_users')->orderBy('last_activity','desc')->limit(10)->get();$this->data['firstNames

php - 路由资源未定义 laravel 5.3

我正在尝试在Laravel5.3中插入​​数据,我是Laravel的新手,我正在尝试使用资源路由系统。当我加载我的页面时,我得到-InvalidArgumentExceptioninUrlGenerator.phpline314:Route[/admin/register-account.store]notdefined.路线Route::group(['middleware'=>'auth'],function(){//ApplicaionhomeRoute::get('/home','HomeController@index');//AdminroutesRoute::get('/

php - Laravel 5.3 在 API 中过滤搜索数据

我正在为前端和移动应用程序实现一个API,现在我正在开发搜索功能,用户可以在其中键入列名或任何data我应该能够以JSON格式提供他们请求的数据所以我做了这个在我的Controller中publicfunctiongetSearchResults(Request$request){$data=$request->get('data');$search_drivers=Driver::where('agent_id','like',"%{$data}%")->orWhere('registration_center','like',"%{$data}%")->orWhere('regis

php - Laravel 列表 concat 不显示数据(全名)

我在我的项目中使用Laravel5.3,我试图获取多个列并在View的下拉选择元素中显示数据。我正在做这样的查询:$users=User::select(DB::raw("CONCAT(first_name,'',last_name)ASfull_name,id"))->lists('full_name','id')->toArray();但这是我从中得到的数据:array:6[▼14=>""15=>""16=>""17=>""19=>""22=>""]full_name的值为空,我该如何解决? 最佳答案 尽量避免使用full_na

php - Laravel 5.3 存储和读取文件目录

目前正在尝试处理文件,但很难弄清楚将它们放在哪里以及如何在列表中读回它们。我尝试将几个测试文件放入$files=array();$dir=opendir(asset('files');//openthecwd..alsodoanerrcheck.while(false!=($file=readdir($dir))){if(($file!=".")and($file!="..")and($file!="index.php")){$files[]=$file;//putinarray.}}但尽管其中有3个测试文件,它还是返回空白。查看幼虫食谱和建议说File:allFile()这不是受支持

php - Laravel 路线不适用于生产

我有一个Laravel5/angularJS应用程序(将Laravel作为apirest和angular作为前端)在我的本地环境中,一切都像魅力一样运作。但是当我上传到主机时,我只能访问索引页面,其他所有内容都会抛出404。在我的共享主机中,我有这样的文件系统。public_htmllaravel-backend(ithasapp,bootstrap,confi...etc,alllaravelapp)laravel-frontend(itwouldbelikethepublicfolderofthelaraveldefaultfilesystem).htaccess.htaccess

php - Laravel 在一个函数中加载多个 View

我只知道如何在单个Controller函数中调用多个View。我正在尝试:returnView::make('header');returnView::make('main');returnView::make('footer');任何建议。我如何称呼他们?提前致谢.. 最佳答案 您应该使用sections创建一个View为了便于重复使用。然后它允许您组成各个部分。layout.blade.php@yield('header')@yield('body')@yield('footer')combined.blade.php@exte