Jump to content

Search the Community

Showing results for tags 'laravel'.



More search options

  • 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 (Dreamweaver, Zend, 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

Found 26 results

  1. I'm starting to use Docker with Laravel, so I installed Laradock inside my existing Laravel project following the documentation, every step until the command docker-compose up -d nginx mysql the first time the command works and I can use my application. Then I've used the command docker-compose stop and of course I can't reach my site because the webserver is off running again docker-compose up -d nginx mysql I obtain this error ERROR: for laradock_mysql_1 Cannot start service mysql: error while creating mount source path '/host_mnt/c/xampp/htdocs/laratest/laradock/mysql/docker-entrypoint-initdb.d': mkdir /host_mnt/c/xampp/htdocs/laratest: file exists I've already tried docker-compose down before to run again the up command, but with no luck why does this happen? How do I correctly stop Docker and restart again? P.S. You see the path c/xampp/htdocs, that is where my projects are (until now I was used to use xampp for developing webapps on my local machine), but xampp is now not started, so it doesn't have any effect on Docker. I'm on a Windows 10 machine
  2. I currently have an array that I've built that dumps like this: 0 => array:11 [▼ "category_code" => "123" "category_name" => "Testing" "category_description" => "This is a test category" 19738 => array:5 [▼ "identifier" => "720368842943" "description" => Test Description One "count" => 4 "details" => array:2 [▼ 0 => array:3 [▼ "detail_code" => "2751" "detail_code2" => "43" "detail_specifier" => "Detail One" ] 1 => array:3 [▼ "detail_code" => "2681" "detail_code2" => "9" "detail_specifier" => "Detail Two" ] ] "prices" => array:1 [▼ "01" => "1129.00" ] ] 19739 => array:5 [▼ "identifier" => "720368844121" "description" => "Test Description Two" "count" => 4 "details" => array:2 [▼ 0 => array:3 [▼ "detail_code" => "2751" "detail_code2" => "43" "detail_specifier" => "Detail One" ] 1 => array:3 [▼ "detail_code" => "2681" "detail_code2" => "9" "detail_specifier" => "Detail Two" ] ] "prices" => array:1 [▼ "01" => "1490.00" ] ] I'm using laravel excel in order to export that as an excel file, but it's not quite working the way I intend When it exports to excel I only get the top level info: 123 | Testing | This is a test category But I want to get that info as a header and then each subsequent product for that category as a row, so with the example above it would look like: 123 | Testing | This is a test category ==================================================================================================================== 19738 | 720368842943 | Test Description One | 4 | 2751 | 43 | Detail One | 2681 | 9 | Detail Two | 1129.00 19739 | 720368844121 | Test Description Two | 4 | 2751 | 43 | Detail One | 2681 | 9 | Detail Two | 1490.00 Here's the excel code with the array I'm using, which is dumped above: $allCategoryResult= array(); foreach($prices->categories as $category){ $categoryItem = array(); $categoryItem["category_code"] = $category->category_code; $categoryItem["category_name"] = $category->category_name; $categoryItem["category_desc"] = $category->category_desc; foreach($category->skus as $sku){ $skuItem = array(); $skuItem["identifier"] = $sku->sku_info->identifier; $skuItem["description"] = $sku->sku_info->item->description; $skuItem["count"] = $sku->sku_info->item->item_type->count; $skuItem["details"] = array(); foreach ($sku->sku_info->details as $details) { $detailsItem = array(); $detailsItem["detail_code"] = $details->detail_code; $detailsItem["detail_code2"] = $details->detail_code2; $detailsItem["detail_specifier"] = $details->detail_specifier; $skuItem["details"][] = $detailsItem; } $skuItem["prices"] = get_object_vars($sku->prices); $itemCode = $sku->sku_info->item->item_code; $categoryItem[$itemCode] = $skuItem; } $allCategoryResult[] = $categoryItem; } $name = 'Test Export'; $build = Excel::create($name, function ($excel) use ($allCategoryResult) { $excel->setTitle('Test Export'); $excel->sheet('Test Export', function ($sheet) use ($allCategoryResult) { $sheet->fromArray($allCategoryResult);
  3. I'm writing a small applications with episodes which contain 10-15 screenshots with each screenshot having 5 different resolutions. Every week there are about 20 new episodes. You can imagine that every week I have a lot of screenshots which have to be somehow linked to their respective episode. Currently the filenames are stored in a MySQL database, but after 5 minutes of testing I already have 100+ rows. Not quite sure if that's a smart way of moving forward. The advantage of having them in the DB is that I can easily grab them using Eloquent ORM without having to finnick around with regeneration of filenames for on the fly loading. Are there any good other alternatives of linking multiple files to database entries? Or should I just stick with the current method? What would be some adverse effects of doing it this way?
  4. Hi I’m trying to develop an online application that will allow ‘Candidates’ to book on courses that “Providers” have posted. The application is going to have 4 different types of users, please see attached ‘Figure 1.4 - JobSkilla User Permissions & Roles.jpg’ all of which have different information associated with them. On first signup of a provider they will complete a company profile and a user will be created as the owner associated with that “Provider” that user will then be able to invite their team members (Team associations) to share the same “Provider” data but with restricted access to areas such as billing / invoives. I’m going to be building the application using laravel 5.2, I still want to use laravels Auth but how can I allow multiple auths? I was thinking of having a table called “Auth” that could manage the logins with a forging key to the ‘candidates’, ‘providers’ table. What’s the best way of handling multiple logins that are associated with 1 “Provider”? I’ve attached a EER diagram with the current database design this may be incomplete. I wanted to ask for some guidance with the best way to program/db design the project. I would appreciate if anyone can give me a better solution or point me in the right direction. I don't mind paying for advice. JobSkilla EER Diagram.pdf
  5. DallasTechRecruiter

    RealPage in N Dallas is hiring 10 Dev's

    RealPage in North Dallas is has 10 PHP Developer openings. All Direct Hire, No Remote. We are innovating from within and building our new generation of products, such as Rentjoy (http://www.realpage.com/realworld/ -watch Rentjoy Keynote – Dustin Gellman, our SVP Innovation Lab), ALL PHP. Ideally they would have Laravel experience but not required. RealPage is a growing SaaS and Cloud provider for the multifamily and rental industry with over 65 products. Job Desc: PHP Web Developer Job at RealPage, Inc. in Dallas/Fort Worth Area |https://www.linkedin.com/jobs/view/185472378 You can message me or you can apply online. Open to helping with relocation. John Laury john.laury@realpage.com
  6. lilmer

    Dynamic URL

    I am new to Laravel, I have registration form which set an extension on the URL on the database table for each user. Example. I am using Laravel 5.6. Anyone can suggest what is the best way to get check if the URL exist on the database and it will proceed. As I now I try to set the Model and make a condition on the config/routes.php to check if the extension from database, but I know it is not the best solution.
  7. I am new to the Laravel Framework, doing an internship and at the very end.. I need some assistance please with some try catch error, Its supposed to throw an error if the site name is already in the database.. If someone could help me please and thank you .. ``` public function create() { return View::make('edit.create'); } public function edit( $clientsite ) { return View::make('edit.edit', compact('clientsite')); } public function saveCreate() { $input = Input::all(); try { $clientsite = new ClientSite; $clientsite->siteName = $input['siteName']; $clientsite->description = $input['description']; $clientsite->launchDate = $input['launchDate']; $clientsite->save(); //ClientSite::whereSiteName($clientsite->siteName)->first(); ClientSite::where('siteName', $clientsite->siteName)->first(); $clientID = $clientsite['clientID'];//getting clientID for use in join query //queries for retrieving features of each group for the selected client $clientFeatures = DB::table('features')->join('clientFeatures', function($join) use($clientID) { $join->on( 'clientFeatures.featureID', '=', 'features.featureID') ->where('clientFeatures.clientID', '=', $clientID); })->get(); $groupIDs = array(); foreach ($clientFeatures as $c) { $groupIDs[] = $c->groupID; } catch(\Illuminate\Database\QueryException $e) { return View::make('profiles.clientProfiles')->with('clientsite',$clientsite) ->with('groupIDs',$groupIDs) ->with('clientFeatures',$clientFeatures) ->with('status','<strong>'.$siteName.' Site already exist!</strong>'); ; } ``` https://github.com/webdevdea/MyDyn ( i have not pushed these changes because I have an error )
  8. GoodWorld is an early-stage, venture-funded start-up changing the face of philanthropy through an innovative approach to online fundraising. Our technology allows you to donate without leaving social media, simply by writing #donate on any Facebook post or when you tweet at any of our partner charities. Job Description GoodWorld seeks an experienced PHP developer with a passion for elegant/functional code as well as doing good in the world. The ideal candidate will have experience leading a development team and with agile development methods. Responsibilities: - Determine operational feasibility by evaluating analysis, problem definition, requirements, solution development, and proposed solutions. - Document and demonstrates solutions by developing documentation, flowcharts, layouts, diagrams, charts, code comments and clear code. - Prepare and install solutions by determining and designing system specifications, standards, and programming. - Improve operations by conducting systems analysis - Obtain and license software by obtaining required information from vendors; recommending purchases; testing and approving products. - Collecting, analyzing, and summarizing development and service issues. - Develop software solutions by studying information needs, conferring with users, studying systems flow, data usage, work processes, and investigating problem areas Skills & Requirements Experience: - PHP - MySQL - PHPUnit or other testing framework - Ubuntu server administration - Twitter API and Facebook API integration Bonus, experience with: - Amazon Web Services - Continuous deployment - Laravel framework - Payment gateway integrations Location: Onsite strongly preferred, but open to remote employment Salary: $60-120K; a small equity allotment also possible If interested, email me at rasheen@nsphire.com
  9. I am getting this error: syntax error, unexpected '}' @extends('layouts.master') @section('scripts') <script type="text/javascript" src="{!! asset('js/status.min.js') !!}"></script> @stop @section('content') {!! csrf_field() !!} @if (count($errors) > 0) <div class="alert alert-danger"> <strong>Whoops!</strong> There were some problems with your input.<br><br> <ul> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif <!-- Using laravel session --> @if(Session::has('message')) <!-- Checking if session has a variable called message. --> <div class="alert alert-info"> <li> {{ Session::get('message') }} </li> <!--if true -print the message from the insert_posts variable. --> </div> @endif {{-- You have a $user variable available representing the current Auth::user(); --}} <p>Hello, {{ $user->name }}.</p> {{-- This user has a profile whose properties you can also display --}} <p>Goals: {{ $user->profile->goals }}</p> {{-- You can also drill down to the profile's expectations --}} <p>Expectations</p> <ul class="profile-list"> @foreach($user->profile->expectations as $expectation) <li class="profile-list-item">{!! $expectation->name !!}</li> @endforeach </ul> <p><b> this is other users you may want to follow: </br></p> <ul> @foreach($mutuals as $mutual) <!-- hub/{{$mutual->user->id}} It goes to the user that matches the value of $mutual criteria. and then it goes and gets its id.This is sent to the controller for further handling.Check page source to see id's numbers. --> <!-- In the href - Passing the user to your controller --> <br><li><a href="{{URL::to('hub', [$mutual->user->id])}}" class="button button-3d" name="make_follow">Follow User</a> {!! $mutual->user->name; !!} <!-- I access the user's name property --> </li> @endforeach </ul> <form action="{{ route('createPost') }}" method="post"> <!--the form action is the method in a route called createPost --> @if(isset($message)) <!-- if the var exist and have a value it would be printed. It is used for all the notifications in this page.--> {{ $message }} @endif <br> <!-- only when a post has been submitted the varible value will show. --> <!-- telling the form the info go to this route (url). almost equal form action ="samePage" --> {!! Form::hidden('post') !!} {!! csrf_field() !!} <div class=contentWrap> <div class="test" placeholder="How's your fitness going?..." contenteditable="true"></div> </div> <div class=icons> <img alt="heart" src="http://icons.iconarchive.com/icons/succodesign/love-is-in-the-web/512/heart-icon.png"> </div> <button> Post to profile </button> <div class="errors"> </div> </form> <!-- script to check if user typed anything in the textbox before submit. both .text() and .html() return strings. It's testing if the string length is zero. trim is for removing whitespaces before and after a string. the 'submit' event is needed since it's a submit button. --> <div class="own_posts"> <p> here are your latest posts:</p> <!-- I think I should create foreach loop to iterate over each post and show it here. --> </div> <br><br> <div class="following_posts"> <p> Posts from people you're following: <p> <!-- Iterate over the followee's posts with a foreach loop: the first parameter the foreach gets is the array expression. Second element: On each iteration, the value of the current element (which is a post) is assigned to $value (second element) and the internal array pointer is advanced by one. Next: within these: {{!! !!}} --> @foreach ($get_followee_posts as $post) <form action="/html/tags/html_form_tag_action.cfm" method="post"> <textarea name="comments" id="comments" style="width:96%;height:90px;background-color:white;color:black;border:none;padding:2%;font:22px/30px sans-serif;"> {!! $post->full_post !!} </textarea> </form> @endforeach </div> @stop I tried with 2 editors and netbeans to figure why. I also use blade syntax of laravel.
  10. I'm looking for one or two talented Laravel guys in the Dallas area who write clean code, document well, and love pushing the limits of their own abilities. It is important that the developers we hire are local. Please do not respond if you do not live in the Dallas area. Preferred knowledge - Laravel - AngularJS - NodeJS - jQuery - MySQL - HTML/CSS - e-Commerce - Paranoid about security - Performance minded We are developing applications that will process millions of dollars in transactions every month. Performance, security, and the ability to scale is paramount. Thank you
  11. Danny620

    Access errors field

    Hi, I am building a restfull service and i would like to out put a error like the following { "error": true, "message": "Validation failed", "code": 400, "errors": [ { "field": "first_name", "error": "The first name field is required." }, { "field": "first_name", "error": "The last name field is required." }, { "field": "first_name", "error": "The gender field is required." }, { "field": "first_name", "error": "The city id field is required." }, { "field": "first_name", "error": "The postcode field is required." }, { "field": "first_name", "error": "The email field is required." }, { "field": "first_name", "error": "The password field is required." } ] } but i cant seem to read the array key as what the vailidation failed on $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { $errors = array(); $messages = $validator->messages(); //print_r($messages); foreach ($messages->all() as $value) { $errors[] = array('field' => 'first_name', 'error' => $value ); } $response = Response::json(array( 'error' => true, 'message' => 'Validation failed', 'code' => 400, 'errors' => $errors ) ); //$validator->messages() return $response; }
  12. I have this code: class DropzoneController extends Controller { public function __construct() { $this->middleware('auth'); if (!Auth::check()) { return redirect('auth/login'); } $this->user = Auth::user(); } public function index() { return view('dropzone_demo'); } public function uploadFiles() { $message="Profile Image Created"; $input = Input::all(); $rules = array( 'file' => 'image|max:3000', ); $validation = Validator::make($input, $rules); if ($validation->fails()) { return Response::make($validation->errors->first(), 400); } $destinationPath = 'uploads'; // upload path: public/uploads $extension = Input::file('file')->getClientOriginalExtension(); // getting file extension $fileName = rand(11111, 99999) . '.' . $extension; // renameing image $upload_success = Input::file('file')->move($destinationPath, $fileName); // uploading file to given path if ($upload_success) { return Response::json('success', 200); } else { return Response::json('error', 400); } // attaching the profile image to the authenticated user. $user->profileImage()->create([ 'filename' => $filename ]); Session::flash('new_profile_image', 'Profile Photo Updated!'); } public function authorize($ability, $arguments = Array) { // set to true instead of false return true; } } The error occurs for this line: public function authorize($ability, $arguments = Array) and it says: syntax error, unexpected ')', expecting '(' Not sure what that means. Anyone who can tell me what the issue is?
  13. Hello, I installed composer and then I tried installing the laravel command line functions as it was described in their website, namely I ran this command: composer global require "laravel/installer=~1.1" Taken from directly from the official website - http://laravel.com/docs/4.2#install-laravel But when I run: laravel new blog I get an error: C:\xampp\htdocs>laravel new blog 'laravel' is not recognized as an internal or external command, operable program or batch file. Please help! I really want to use the "laravel" command lines from the CMD. I am on Windows 8.1. I searched a lot in Google for help but with no luck Many thanks!
  14. gemmabowron

    PHP Developers Wanted - Germany

    I am currently recruiting for a number of fantastic PHP Developer roles in Germany (English or German speakers) of all levels (Junior, Mid-Level, Senior, Technical Lead) to work with some impressive companies within a variety of industries in Munich, Berlin and Hamburg. Salaries ranging from €40,000 - €75,000 (Depending on experience). Are you considering new opportunities at the moment? Please contact me for further information and to take the first step towards your new role! gemma.bowron@quantica-technology.co.uk
  15. I have started a project using laravel. I am in the process of builing User groups and permissions in the admin dashboard. I have uploaded a snapshot of my views to which i want to restrict access. i want to structure it to be completely dynamic
  16. Hi, This code works (and correctly shows just one result in my view); $people = DB::table('people')->where('id', '=', $person_id)->get(); But this one doesn't; $people = DB::table('people')->where('id', $person_id)->first(); And produces the error; Trying to get property of non-object (View: /media/sf_sandbox/health/app/views/agreement/display.blade.php) The `people` table just has a few fields of information on the individual with a primary key called `id`. I followed the Laravel guide on select statements. I don't understand what the error is trying to tell me and I don't get why that second statement is wrong. What's so wrong about it? I just want to understand Laravel/Objects better.... Thanks
  17. Hi all, I’m building a search engine to find courses online; I wanted to ask for some guidance with the best way to program/structure the project. I’m going to be building the application using laravel 5.2 I have 3 different types of users as follows Users Course Providers Advisors All of which have different information associated with them such as Users Table first_name last_name date_of_birth email password Course Providers – this needs to have multiple logins associated with the course provider company_name address_line_1 address_line_2 postcode tel Advisors company_name first_name last_name email password I still want to use laravels Auth but how can I allow multiple auths or am I best in using roles if so how would this work? What’s the best way of handling multiple logins that are associated with 1 company? I would appreciate if anyone can give me a better solution or point me in the right direction.
  18. Hi, I have an app that is in development phase created using php and javascript. I have a couple of plugins - dataTable and exportTable added in the web app. The app has multiple tabs. So far, I have a fairly simple login page that is not even connected to the database. I am thinking about using Laravel framework and build the app on top of it. Will I have to just configure the index.php file in Laravel's public directory and drop all the used files in public directory or I will have to work with each files in Views, Controller, and public? How hard or difficult would that be? Thanks
  19. Europe's biggest gaming company are looking to take on up to 10 PHP Developers to join their expanding development team working on new game releases. They can offer relocation assistance and most interviews take place purely over Skype, or they can fly you over if required. Its an English speaking company and could be making you an offer in the next week! Please email me @ stuart.day@quantica.co.uk asap.
  20. I-AM-OBODO

    links wont work on laravel

    Hi all. No matter what i tried my links just wont work on my laravel app. My css folder is in the public folder. public/css. I dunno what is wrong. I installed laravel with composer and i am running windows 7 and wamp. this is the link i used: <link rel="stylesheet" href="{!! asset('css/bootstrap.min.css') !!}"> <link rel="stylesheet" href="{!! asset('css/styles.css') !!}"> Thanks
  21. I am really struggling with the logic aspect of my application. I can't picture the structure and get it clear in my mind. As a result, I can't code anything because I'm second-guessing myself at every turn. My application is pretty simple in reality. It's an application that keeps a record of all the different 'contracts'/'agreements' that my colleagues have signed. Some will have signed three or four depending on what systems they are working on. The application will run a cron, daily, and send out an email to anyone who's contract/agreement is about to expire with an invite for them to renew it. I have already built an application that has a login system and authentication (using Laravel). It was my first Laravel effort and I did it using a tutorial from YouTube. I figured I could use the one login from that to act as the administrator for this whole application. Once the administrator is in, they will be presented with a panel to do various things. This is the part I am stuck on. What do you all think of my "logic"? Here are the basic routes (forgetting the auth stuff which is already done); /contracts - to see a list of all the contact templates out there. /contracts/{contract-id} - to view the specific contract template /contracts/create - GET and POST to be able to add new contract templates for other systems /people - view all my colleagues on one page /people/{person-id} - view a specific colleague and all the contracts they have signed /people/create - GET and POST for this too to be able to add new colleagues to the system /people/{person-id}/create-new-contract - so this would add a record in to a third table which joins info from the people table and the contracts table to make a list of unique contract agreements for each person and their expiry date. GET and POST for this as well I suppose. Even as I'm writing this, I don't know if this will be needed because I might have an emailing class that might do this job better? Hence the writing of this post! /agreements/renew/{renew-code} - This will create a new record in the table and amend the old one to show that the previous agreement has expired and that a new one for the next 365 days is in place.As you can probably tell.. I am struggling a bit. Is there any advice you can give me to help me mentally map out my application before I start coding? I just want to get it right..
  22. Korferer

    Hello from... Bristol, UK

    Hi. I'm not exactly new to PHP but I am brand new to this community. I have been PHP aware for about 5 years but in all that time the amount of coding I have actually done has been rather pathetic. I work for a company that is quite... insular, and secluded (their choice, not mine) from the wider developer community. As a result I only discovered PHP Frameworks about a year ago and feel quite behind the times. I am used to writing procedural PHP and not much else. I am here to hopefully broaden my horizons and get a better understanding of Frameworks, OOP, SQLi or PDO or database "unspecific" applications. When I first discovered PHP Frameworks about a year ago, my friend suggested I get started using CodeIgniter (that seems to be a lot of newbies' first choice!). I loved it, but after reading various rantings and ravings on the internet I decided that I should probably move on to something more "professional". That's when I came up against SF2 and almost cried myself to sleep every night. It made no sense to me. It still makes no sense to me. I gave up. After that I tried Laravel but couldn't even get going thanks to something called "Composer" which I still don't understand. I thought to myself, "I don't want to learn about dependencies at this stage, I just want to code". I gave up. Then another friend suggested I use PHP Slim. Another Framework. I tried to work with it but it seemed heavily dependant on knowing OOP, and I didn't have the first clue what I was doing. I gave up (are you sensing a pattern here?) So after that, I decided to try and learn the basics of OOP and how/why it was better than procedural and I have to say - I don't think it is. And I kind of hate it. I find it really confusing and not one person I have asked is able to tell me why OOP is better than procedural. They say "it just is". Sigh.... Then I decided to join PHP Freaks so I could vent my frustrations!
  23. I'm creating a social network site using Laravel. I have a page that load all the posts created by users the currentUser follows. I have a comment section on each post. I'm using ajax to post the comments. Here is my code. Here is the view of the comment-box. It contains a section where I loop through each comment and display them. At the end is the type field so a user can post a new comment: <div class="comment-box-container ajax-refresh"> <div class="comment-box"> @if ($type->comments) @foreach ($type->comments as $comment) <div class="user-comment-box"> <div class="user-comment"> <p class="comment"> <!-- starts off with users name in blue followed by their comment--> <span class="tag-user"><a href="{{ route('profile', $comment->owner->id) }}">{{ $comment->owner->first_name }} {{ $comment->owner->last_name }}</a> </span>{{ $comment->body }} </p> <!-- Show when the user posted comments--> <div class="com-details"> <div class="com-time-container"> {{ $comment->created_at->diffForHumans() }} · </div> </div> </div><!--user-comment end--> </div><!--user-comment-box end--> @endforeach @endif <!--type box--> <div class="type-comment"> <div class="type-box"> {{ Form::open(['data-remote', 'route' => ['commentPost', $id], 'class' => 'comments_create-form']) }} {{ Form::hidden('user_id', $currentUser->id) }} {{ Form::hidden($idType, $id) }} {{--{{ Form::hidden('user_id', $currentUser->id) }}--}} {{ Form::textarea('body', null, ['class' =>'type-box d-light-solid-bg', 'placeholder' => 'Write a comment...', 'rows' => '1']) }} {{ Form::close() }} </div><!--type-box end--> </div><!--type-comment--> </div><!--comment-box end--> The user submit the form for the comment type box by pressing the "enter/return" key. Here is the JS for that <script> $(document).on('keydown', '.comments_create-form', function(e) { if (e.keyCode == 13) { e.preventDefault(); $(this).submit(); } }); </script> Here is my Ajax (function(){ $(document).on('submit', 'form[data-remote]', function(e){ e.preventDefault(); var form = $(this) var target = form.closest('div.ajax-refresh'); var method = form.find('input[name="_method"]').val() || 'POST'; var url = form.prop('action'); $.ajax({ type: method, url: url, data: form.serialize(), success: function(data) { var tmp = $('<div>'); tmp.html(data); target.html( tmp.find('.ajax-refresh').html() ); target.find('.type-box').html( tmp.find('.type-box').html() ); tmp.destroy(); } }); }); })(); When I post a comment on the first post it all works fine. However, when I post a comment on the second, third, fourth etc it only displays the comments from the first post. I have to manually refresh the page, then the correct comments will display. I'll try to illustrate this problem with images. Starting fresh, I can easily submit 2 comments on POST 1 http://s27.postimg.org/6ej76hunn/comment1.jpg When I scroll down to Post 2, I see it already has a comment, I will submit a new comment http://s23.postimg.org/x65ui2ryz/comment_2.jpg HERE'S THE PROBLEM: When I submit the comment on POST 2, the comments that were in POST 2 disappears, and are replaced by the comments from POST 1. http://s30.postimg.org/ugl08oz01/comment_3.jpg The back end still worked, because when I reload the page everything is the way it should be http://s9.postimg.org/w51fgyzen/comment_4.jpg I'm completely stuck. Does anyone know why this is happening and how to fix it?
  24. I am trying to pick activityType and show the value in an array that looks like this: http://4.1m.yt/ukCLELP.png I want the activityType value to be an actual option like: option1,option2 etc.. But it throws an error instead (when trying to change values of it): ErrorException in c3b8369e5906a262c6e3760a4e5a65e9 line 35: Use of undefined constant Aerobics - assumed 'Aerobics' (View: /var/www/L53/resources/views/dashboard.blade.php) here's my relevant view code snippet: ) What do you expect from this app to help you? <br><br> (You can always change this later) <br><br> &nbsp{!! Form::checkbox('expectations','New anerobic routines'); !!} Find new anerobic routines <br> &nbsp{!! Form::checkbox('expectations','New aerobic routines'); !!} Find new aerobic routines <br> &nbsp{!! Form::checkbox('expectations','Follow'); !!} Follow other users to get inspired <br> <br><br> Thanks!
  25. I am partnered with a marketing company located in downtown Chicago that is in need of a Sr. PHP Developer. This person will be designing, planning, and building complex content and data management systems from the ground up utilizing PHP technologies and frameworks. This is a permanent/direct hire opportunity. Must have experience with: CodeIgniter or Laravel frameworks GIT or SVN Front end technologies (HTML, CSS, etc.) Salary expectations: $100k - $125k (based on experiene) If interested please send resumes/inquries to Brittany Green at bgreen@awistaffing.com Please note: We do not offer sponsorship at this time (h1b, L2, etc.)
×

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.