Jump to content

Search the Community

Showing results for tags 'laravel'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Does this look like the right way to do READ UNCOMMITTED in Laravel? $cars = Cars::raw('SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;')->Active()->get(); Thanks!
  2. I'm wondering if anyone know if there's a good tutorial for new people to laravel and teaches you how to create a user/password login page? I used to watch tutorial of laravel 3.1 in tutsplus.com a 6 hours tutorials and got me interested with laravel and then 4 came out which I know added lots functions which makes things even more easier than before and I'm thinking of learning how to make a user/password login/sign up page. Any recommendation where I can get find tutorials like that? Because with videos instead of just words, I tried youtube and no luck for me
  3. Hi, I am going to build a bus ticket booking application. I am very much familiar with Codeigniter and used in 8 projects. But FuelPHP and latest trend of Laravel are knocking my heart. I have learned FuelPHP and Laravel but not yet build any app. Ellis lab dis-counted the support and development for CI, hence it is half dead as community is still active. But now I want to try something new so which of the following is perfect for bus booking application ? FuelPHP or Laravel ? While reading their Docs, I think FuelPHP is easy compared to Laravel. But if Laravel is going to give more advantages, I will go for it.
  4. I am building a relatively small app in laravel. Currently I am trying to create a load more button to load more images into a container in the view. Would anyone know when clicking load more I get an internal server error? Here is my set up: View for my images: $instagram = new Instagram\Instagram; $instagram->setAccessToken($_SESSION['instagram_access_token']); $token = $_SESSION['instagram_access_token']; //$clientID = $_SESSION['client_id']; $current_user = $instagram->getCurrentUser(); $tag = $instagram->getTag('folkclothing'); $media = $tag->getMedia(isset($_GET['max_tag_id']) ? array( 'max_tag_id' => $_GET['max_tag_id'] ) : null); $liked_media = $current_user->getLikedMedia(); echo '<section id="images">'; foreach ( $media as $item ) { echo '<article class="instagram-image">'; // define the form and set the action to POST to send the data to this script echo '<form class="forms" action="'; echo URL::current(); echo '" method="post">'; $id = $item->getId(); echo '<a class="fancybox" href="' . $item->link . '"><img src="' . $item->images->standard_resolution->url . '" /></a>'; if ( $current_user->likes($item) ){ echo '<button class="ajax instabtn unlike icon-heart" type="submit" name="action" value="Unlike"></button>'; } else { echo '<button class="ajax instabtn like icon-heart" type="submit" name="action" value="Like"></button>'; } echo '<input type="hidden" name="id" value="'; echo $id; echo '">'; echo '<p>'; echo $item->likes->count; echo '</p>'; //echo '<p>'.$item->getId().'</p>'; //echo '<p>By: <em>' . $item->user->username . '</em> </p>'; //echo '<p>Date: ' . date('d M Y h:i:s', $item->created_time) . '</p>'; //echo '<p>$item->comments->count . ' comment(s). ' . $item->likes->count . ' likes. '; echo '</form>'; echo '</article>'; } echo '</section>'; Here the instagram class generates the images and puts them into the div through a loop. Below is a load more button storing the data need in it. Load more button: echo "<br><button id=\"more\" data-maxid=\"{$media->getNextMaxTagId()}\" data-tag=\"{$tag}\">Load more ...</button>"; And then there is an ajax view that stores the relevant data for the images to be found for the next page: <?php // set up autoloader function app_autoloader($class) { include './' . $class . '.php'; } spl_autoload_register('app_autoloader'); // Initialize class for public requests $instagram = new Instagram\Instagram; // Receive AJAX request and create call object $tag = $_GET['tag']; $clientID = $instagram->getApiKey(); $media = $tag->getMedia(isset($_GET['max_tag_id']) ? array( 'max_tag_id' => $_GET['max_tag_id'] ) : null); $call = new stdClass; $call->next_max_id = $maxID; $call->next_url = "https://api.instagram.com/v1/tags/{$tag}/media/recent?client_id={$clientID}&max_tag_id={$media->getNextMaxTagId()}"; // Receive new data $media = $instagram->pagination($call); // Collect everything for json output $images = array(); foreach ($media->data as $data) { $images[] = $data->images->standard_resolution->url; } echo json_encode(array( 'next_id' => $media->getNextMaxTagId, 'images' => $images )); This page finds the tag and gets the media for that tag and finds the next_max_id. In my jquery I use and ajax call to get this data and load the images into my div but instead I get an internal server error like so: Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://client:8888/ajax?tag=client&max_tag_id=1374869525975&_=137571153802 Does anyone have an idea why it would not produce the results? I know its not too far off. Thanks, Mark ajax.blade.php image.blade.php
  5. Hi everyone I'm in learning laravel, really a newbie. It's seems somehow I can't pass the variables from controllers to view. So this is what I've got config/route.php Route::get('/' , "PagesController@link"); Route::get('pg' , "PagesController@link"); Route::get('pg/{link}' , 'PagesController@link'); controllers/PagesController.php public function link($link = 'index') { // option 1 return "--->" . $link; // option 2 return View::make('pages.index' , array('link' => $link)); // option 3 return View::make('pages.index')->with('link', $link); // option 4 return View::make('pages.index' , compact('link')); } views/pages/index.blade.php @extends('layouts.frontend') @section('title') @parent - Index file @stop @section('content') <article> <header>This is the {{ $link }}</header> <p>And this is the main body of {{ $link }} file</p> </article> @stop views/pages/layouts/frontend.blade.php <!doctype html> <html> <head> <meta charset="utf-8"> <title> @section('title') Lar4 Test @show </title> {{ HTML::style('css/frontend.css') }} </head> <body> <header id="header"> <div id='banner'> </div> <nav> {{ HTML::link('pg' , 'Home') }} {{ HTML::link('pg/about' , 'About Us') }} </nav> </header> <section> @yield('content') </section> <aside> </aside> <footer> </footer> </body> </html> So if I browse to <site>/pg/sometext only option 1 will work (shows "---->sometext"), all others will thrown an error "Undefined variable: link". If I comment both {{ $link }}, both layout and index views are successfully rendered. Any idea of what am I doing wrong?
  6. Hello, i'm currently developing a website using laravel. I have added a 3 new columns for bravo_book_others table the columns are other_name, gender, and other_address. I have a case like this : User1 want to buy 4 holiday package for user1 friends, so user1 have to input 3 of user1 friends like this : Gender#1 : male Name#1 : a Email#1 : a@gmail.com Address#1 : a street Gender#2 : female Name#2 : b Email#2 : b@gmail.com Address#2 : b street Gender#3 : male Name#3 : c Email#3 : c@gmail.com Address#3 : c street I already done it with the email in the controller like this : foreach ($request->input('other_emails') as $email){ BookOther::create([ 'booking_id'=>$booking->id, 'user_id'=>$booking->customer_id, 'other_emails'=>$email ]); Mail::to($email)->send(new OthersEmail($isi_email1)); } How can i put the other_name, gender, and other_address and store it into the database?? The Model : class BookOther extends Model { use HasFactory; protected $table = 'bravo_book_others'; protected $fillable = [ 'booking_id', 'user_id', 'gender', 'other_name', 'other_address', 'other_emails' ]; public function booking(){ return $this->belongsTo('Modules\Booking\Models\Booking', 'booking_id', 'id'); } public function user(){ return $this->belongsTo('App\User', 'user_id', 'id'); } } The Controller : foreach ($request->input('other_emails') as $email){ BookOther::create([ 'booking_id'=>$booking->id, 'user_id'=>$booking->customer_id, 'other_emails'=>$email ]); Mail::to($email)->send(new OthersEmail($isi_email1)); }
  7. Hi all. I have two tables. categories and products. On the create product page, I have a select dropdown field that I want to populate all the available categories. How can I archive that? This is what I did but I am having error: MY FORM <form> <select name="cat_name" > <option value="">Select One</option> @foreach($categories as $category) <option value="{{ $category->cat_name}}"> {{ $category->cat_name}} </option> @endforeach </form> MY CONTROLLER use App\Http\Controllers\ProductController; use App\Http\Controllers\CategoryController; public function create() { return view('products.create', [ $result = (new CategoryController)->Category() ]); } } Thanks
  8. Hi there. I have posts, post comments and users tables which are all fine in and of themselves, but I'd like users to have a unique name that's specific only to the post to hide their real username. This applies to the post itself, and the comments of the post and must remain consistent. For example, if Bill made a post with the name "BigFish", if they comment on their own post then their comments will also have that same name. Likewise, if another user comments with the name "BowlingBall", their subsequent comments will also have the same name. Now, my first attempt was to have an intermediate table of sorts, containing the post_id, user_id and display_name. This takes the appearance of a composite primary key, which are not supported in Laravel. Laravel relationships of such nature can be achieved with a package called Compoships, which does work and given the nature of the table, their resulting query being a gigantic mess of the following is reasonable at best. (post_id == ? AND user_id == ?) OR (post_id == ? AND user_id == ?) OR ... However, that can quickly scale and definitely hurts. Another way to tackle it is to retrieve all display names for each post ID, but that's then retrieving unnecessary data. It's also possible to scrap the table, store the names in the posts and post_comments tables. That's as simple as checking if the commenter is the post author and use that name, or checking if they've previously commented and use that name. I'm not sure if that's ideal either. This brings me back here, after a decade of inactivity, and I do apologise for the lengthy post. How would I go about achieving what I want to do in the best way possible? What would you do in this scenario? Thanks in advance, looking forward to y'all suggestions.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.