laravel-3

My Routes are Returning a 404, How can I Fix Them?

微笑、不失礼 提交于 2019-12-18 10:17:53
问题 I've just started learning the Laravel framework and I'm having an issue with routing. The only route that's working is the default home route that's attached to Laravel out of the box. I'm using WAMP on Windows and it uses PHP 5.4.3, and Apache 2.2.22, and I also have mod_rewrite enabled, and have removed the 'index.php' from the application.php config file to leave an empty string. I've created a new controller called User : class User_Controller extends Base_Controller { public $restful =

Check for Session timeout in Laravel

放肆的年华 提交于 2019-12-17 15:25:51
问题 I was just wondering if anyone knew how to check for session timeout in Laravel. You can check whether the session has a specific item: if (Session::has('name')) { $name = Session::get('name'); } But you can't check whether the session has expired. It would be nice so that I can report back to the user in a more specific way. "Your session has timed out, please start again." Any thoughts? 回答1: Just use the same logic as the session class itself. if ((time() - Session::activity()) > (Config:

Artisan: Could not find driver

一世执手 提交于 2019-12-13 12:08:52
问题 I'm using Laravel last version: 3.2.1. When I run this on terminal: php artisan migration:install I have this error: could not find driver I made some searches on Google and on Laravel's Forum, nothing. EDIT I have activated the extension and this is what I have on phpinfo() --with-iconv' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo It looks like my pdo is set. Here is an image of my phpinfo() EDIT 2 I've made a little test: <?php try { $dbh = new PDO("mysql

Why would Laravel Sessions fail in just Safari and IE after switching server?

回眸只為那壹抹淺笑 提交于 2019-12-13 11:34:14
问题 New VPS server with Webmin, Apache Centos 6, Laravel application and old database schema. All working fine on old shared host, but on VPS for some reason Laravel's Session storage (Laravel 3.0) is no longer working on Safari or Internet Explorer. It seems that the Session ID is just not saving on the client. Is a good way to force the Laravel Session ID to save on the clients browser? What are the differences between the way Safari/IE store cookies that might be creating this problem, when

Laravel 3 - how to securely store user's data in ubuntu server [closed]

纵然是瞬间 提交于 2019-12-13 05:32:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . In my web application, a user can upload their profile picture. They can sell their mobile online, so they can also upload images of their mobile, but if I store profile picture and mobile photos in mylaravel-app/public/(css js images user-photos) then every other user can see those photos as well. How should I

Laravel image submit button

若如初见. 提交于 2019-12-12 16:13:59
问题 I'd like to know if there is a way to customize the look of a submit button (to be an Image instead) in Laravel 3. Currently, my submit button code looks like this : {{ Form::open('project/delete', 'DELETE') }} {{ Form::hidden('id', $project->id) }} {{ Form::submit('Delete project', array('class'=>'btn')); }} {{ Form::close() }} And it's doing his job correctly. But I don't see how I could customize the submit button and put it as a bootstrap icon for example with ; <i class="icon-trash"></i>

Different databases, same site…with Laravel

ⅰ亾dé卋堺 提交于 2019-12-10 12:22:01
问题 This might not be an appropriate question for stackoverflow....as it might be too specific. But I was wondering if anybody knows how I would have one installation of Laravel, serving a site. But depending on the url, I can access different databases. Ie... www.mainsite.com/company1/login - database1 www.mainsite.com/company1/users - database1 .. www.mainsite.com/company2/login - database2 www.mainsite.com/company2/users - database2 So in the cases above, the site being served is the exact

PHP Laravel Routing Issue

有些话、适合烂在心里 提交于 2019-12-09 11:29:31
问题 My setup currently looks like this application/controllers/register.php class register_Controller extends Base_Controller { public $restful = true; public function get_index() { return View::make('main.register');; } } routes.php Route::controller(Controller::detect()); Route::any('/', function() { return View::make('main.index'); }); Route::any('register',function() { return View::make('register.index'); }); mydomain.com works. mydomain.com/index gives a laravel 404 mydomain.com/register

mod_rewrite remove trailing slash not working in Laravel

独自空忆成欢 提交于 2019-12-08 13:22:56
问题 I have the following code setup in my htaccess file for my Laravel 3 installation: # Removes trailing slashes (prevents SEO duplicate content issues) RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301] # Enforce www RewriteCond %{HTTP_HOST} ^([0-9a-z-]+)\.([0-9a-z-]+)$ [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] # Remove index.php from base URL RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] Which

Laravel 4: custom login and check password

家住魔仙堡 提交于 2019-12-08 06:07:17
问题 I would like to customize my login in laravel 4 where username is either his username or email so what I did is: public static function custom_login($uname,$pwd) { $res = DB::select("select * from users where (username = ? or email = ?) and password = ? and active = 1",array($uname,$uname,$pwd)); return $res; } Now, we all know that password are hashed so you cant use password = ? . how can I check the password if it's correct? 回答1: You can use $password = Hash::make($password); function to