laravel-4

Class 'Monolog\Logger' not found, installation error in Laravel 4

a 夏天 提交于 2020-01-23 01:17:06
问题 I installed Laravel without using composer with typing this command: C:\wamp\www\travail>laravel new project It seems that it is on the good way. Creating application... Application ready! Build something amazing. But when I tried to open my project here: wamp-->localhost-->travail-->project-->public I got this error: Class 'Monolog\Logger' not found 回答1: I solve this issue by doing the following: Check the minimum-stability value in composer.json and set it to stable : "minimum-stability":

Why Laravel still logging a NotFoundHttpException while all routes works?

試著忘記壹切 提交于 2020-01-22 21:21:33
问题 All my registered routes are working. They display the view, yet on every request a NotFoundHttpException shows up in my log file. I'm using NGINX. Could it be my NGINX config? The error that is logged on every request (even though the view shows up): log.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1429 Stack trace: #0 /usr/share/nginx

How do I use BETWEEN and AND in laravel

狂风中的少年 提交于 2020-01-22 18:57:26
问题 HI I am trying to use the following and not sure how to get this fixed SELECT * FROM search_users WHERE match(first_name,last_name,country,city,location,nationality,short_bio) against (?) AND search_users.loc_lng BETWEEN '-0.24272918701172' AND '-0.24272918701172' AND search_users.loc_lat BETWEEN '51.47026338272' AND '51.47026338272' I am trying to write a laravel query that does exactly the same as select * from search_users where ...... and search_users.loc_lng BETWEEN '-0.24272918701172'

Laravel 4 : How are Facades resolved?

ぐ巨炮叔叔 提交于 2020-01-22 11:22:50
问题 I've kind of looking at what's going on Laravel 4 facades under the hood. Let's take this Facade as an example: File::get(someArgs); If i'm not mistaken, the step by step (oversimplified) invocation would be: //static method invocation which are all extended from Facade class File::__callStatic(get, someArgs) //returns an instance of FileSystem File::resolveFacedeInstance('files') FileSystem->get(someArgs) What I'am confused about is in the commented line below of the method File:

How to edit and save custom config files in Laravel?

 ̄綄美尐妖づ 提交于 2020-01-22 07:45:48
问题 I am creating simple web application in Laravel 4. I have backend for managing applications content. As a part of backend i want to have UI to manage applications settings. I want my configuration variables to be stored in file [FOLDER: /app/config/customconfig.php ]. I was wondering if there's any possibility in Laravel how to have custom config file, which can be managed/updated thru backend UI? 回答1: I did it like this ... config(['YOURKONFIG.YOURKEY' => 'NEW_VALUE']); $fp = fopen(base_path

How to edit and save custom config files in Laravel?

我的梦境 提交于 2020-01-22 07:44:41
问题 I am creating simple web application in Laravel 4. I have backend for managing applications content. As a part of backend i want to have UI to manage applications settings. I want my configuration variables to be stored in file [FOLDER: /app/config/customconfig.php ]. I was wondering if there's any possibility in Laravel how to have custom config file, which can be managed/updated thru backend UI? 回答1: I did it like this ... config(['YOURKONFIG.YOURKEY' => 'NEW_VALUE']); $fp = fopen(base_path

Escape string for use in MySQL fulltext search

若如初见. 提交于 2020-01-22 07:11:48
问题 I am using Laravel 4 and have set up the following query: if(Input::get('keyword')) { $keyword = Input::get('keyword'); $search = DB::connection()->getPdo()->quote($keyword); $query->whereRaw("MATCH(resources.name, resources.description, resources.website, resources.additional_info) AGAINST(? IN BOOLEAN MODE)", array($search) ); } This query runs fine under normal use, however, if the user enters a string such as ++ , an error is thrown. Looking at the MySQl docs, there are some keywords,

Escape string for use in MySQL fulltext search

回眸只為那壹抹淺笑 提交于 2020-01-22 07:11:13
问题 I am using Laravel 4 and have set up the following query: if(Input::get('keyword')) { $keyword = Input::get('keyword'); $search = DB::connection()->getPdo()->quote($keyword); $query->whereRaw("MATCH(resources.name, resources.description, resources.website, resources.additional_info) AGAINST(? IN BOOLEAN MODE)", array($search) ); } This query runs fine under normal use, however, if the user enters a string such as ++ , an error is thrown. Looking at the MySQl docs, there are some keywords,

Using $this when not in object context - Laravel 4 PHP 5.4.12

青春壹個敷衍的年華 提交于 2020-01-21 06:51:47
问题 I was attemping to access on my instance on the constructor with the variable $this; In all other method it seem work good when i call $this->event->method() but on this method it throw me an error Using $this when not in object context I just did a research about this issue and the answers i found was all about the version of PHP but i have the version 5.4. what can be the issue? This is the method that i try to call the instance. // all protected variable $event , $team , $app function _

Update live data (like progress bar) in view with Laravel 4

旧时模样 提交于 2020-01-21 00:42:52
问题 TL;DR I would like to send data to update live in a view, such as a progress bar showing the status of an action. What is the best way to do that in laravel 4? The Setup I'm working on a Laravel 4 based project where each user can redeem a serial key. I've made an admin backend where I can easily paste in a list of keys, or upload a file of them. Let's say $key_string is the string of newline-seperated keys that I've uploaded, and want to parse out to then upload the contained key strings